Re: sql2008 diff sql2003 - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: sql2008 diff sql2003
Date
Msg-id 20080909020307.GN4411@alvh.no-ip.org
Whole thread Raw
In response to Re: sql2008 diff sql2003  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
Responses Re: sql2008 diff sql2003  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
List pgsql-hackers
Andrew Gierth wrote:

>  Alvaro> This means we have to support stuff like
> 
>  Alvaro> declare foo cursor for select * from lists;
>  Alvaro> select * from (fetch first from foo) as bar;
> 
> No, that's wrong.

[...]

> so it's like this:
> 
> select * from foo order by bar offset 5 rows fetch first 10 rows only;

Oh, I see -- it's just a cumbersome way to have our LIMIT clause.
What's the "ONLY" for?


> (nothing that I can see assigns any semantics to FIRST vs NEXT, they seem
> to do the same thing)

I was actually thinking that you'd be able to open a cursor and then
invoke the query repeatedly.  With FETCH FIRST it wouldn't work, because
every repetition would get the same rows, but with FETCH NEXT it'd give
you a paginated query.

It seems a lot less useful this way.

-- 
Alvaro Herrera       Valdivia, Chile   ICBM: S 39º 48' 55.3", W 73º 15' 24.7"
"I dream about dreams about dreams", sang the nightingale
under the pale moon (Sandman)


pgsql-hackers by date:

Previous
From: Andrew Gierth
Date:
Subject: Re: SQL standard question about Common Table Expressions
Next
From: Andrew Gierth
Date:
Subject: Re: sql2008 diff sql2003