Peter Eisentraut <peter_e@gmx.net> writes:
> SQL:2008 specifies the following syntax for what we have so far called
> LIMIT and OFFSET
> SELECT ... [ ORDER BY ... ]
> OFFSET num {ROW|ROWS} FETCH {FIRST|NEXT} [num] {ROW|ROWS} ONLY
What does the "NEXT" option mean? I'm a bit worried that this isn't
actually quite equivalent to LIMIT.
> If we want to avoid reshuffling the expression syntax (always good to
> avoid) and avoid making ROWS reserved, we need to make some arbitrary
> restrictions on what kinds of expressions can be used in these clauses.
This syntax seems sufficiently brain-dead that only standards-compliance
fanatics would use it. Accordingly, limiting it to match the letter
of the standard (literals only) is probably sufficient.
BTW, I think it's a bad idea to assign made-up parse locations, as
you did here:
> + | /*EMPTY*/ { $$ = makeIntConst(1, @$); }
Just use -1.
regards, tom lane