Re: Parameters don't work in FETCH NEXT clause? - Mailing list pgsql-hackers

From Shay Rojansky
Subject Re: Parameters don't work in FETCH NEXT clause?
Date
Msg-id CADT4RqD=GaWMqbYbos_BWyrzapY5OvN=X05nASdoa2hWGkzGxQ@mail.gmail.com
Whole thread Raw
In response to Re: Parameters don't work in FETCH NEXT clause?  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-hackers
​Would something like this be valid?

OFFSET { start_literal | ( start_expression ) } { ROW | ROWS }
FETCH { FIRST | NEXT} [ count_literal | ( count_expression ) ] { ROW | ROWS } ONLY

Leaving the mandatory parentheses detail to the description, while adequate, seems insufficient - especially when a normal LIMIT expression is not so restricted.

​And don't you think the section header would be more accurately named:

Limit, Offset & Fetch Clauses

​The nuance regarding "different standard syntax" is unknown to the reader who first looks at the syntax and sees three different lines, one for each clause, and then scrolls down looking at headers until they find the section for the clause they are interested in.  That FETCH is an alias for LIMIT ​is not something that I immediately understood - though to be honest I don't think I comprehended the presence of FETCH on a SELECT query at all and thought it only pertained to cursors....


All these suggestions would definitely have saved me (and therefore this list!) some time.

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: seg fault in contrib/bloom
Next
From: Masahiko Sawada
Date:
Subject: Re: Reviewing freeze map code