Re: [HACKERS] Parameters don't work in FETCH NEXT clause?

2016-05-17 Thread Shay Rojansky
> > ​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 -

Re: [HACKERS] Parameters don't work in FETCH NEXT clause?

2016-05-17 Thread David G. Johnston
On Tue, May 17, 2016 at 12:15 PM, Shay Rojansky wrote: > Apologies, as usual I didn't read the docs carefully enough. > > On Tue, May 17, 2016 at 7:13 PM, Tom Lane wrote: > >> Shay Rojansky writes: >> > A user of mine just raised a strange

Re: [HACKERS] Parameters don't work in FETCH NEXT clause?

2016-05-17 Thread Shay Rojansky
Apologies, as usual I didn't read the docs carefully enough. On Tue, May 17, 2016 at 7:13 PM, Tom Lane wrote: > Shay Rojansky writes: > > A user of mine just raised a strange issue... While it is possible to > use a > > parameter in a LIMIT clause, PostgreSQL

Re: [HACKERS] Parameters don't work in FETCH NEXT clause?

2016-05-17 Thread Tom Lane
Shay Rojansky writes: > A user of mine just raised a strange issue... While it is possible to use a > parameter in a LIMIT clause, PostgreSQL does not seem to allow using one in > a FETCH NEXT clause. In other words, while the following works: > SELECT 1 LIMIT $1; > The following

[HACKERS] Parameters don't work in FETCH NEXT clause?

2016-05-17 Thread Shay Rojansky
A user of mine just raised a strange issue... While it is possible to use a parameter in a LIMIT clause, PostgreSQL does not seem to allow using one in a FETCH NEXT clause. In other words, while the following works: SELECT 1 LIMIT $1; The following generates a syntax error: SELECT 1 FETCH NEXT