Re: Fix for FETCH FIRST syntax problems
Andrew Gierth <andrew@tao11.riddles.org.uk>
From: Andrew Gierth <andrew@tao11.riddles.org.uk>
To: pgsql-hackers@postgresql.org
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Vik Fearing <vik.fearing@2ndquadrant.com>,
Michael Paquier <michael@paquier.xyz>
Date: 2018-05-20T03:25:33Z
Lists: pgsql-hackers
Attachments
- ff2.patch (text/x-patch) patch
Updated patch. This one explicitly accepts +/- ICONST/FCONST in addition to c_expr for both offset and limit, removing the inconsistencies mentioned previously. I changed the wording of the docs part a bit; does that look better? or worse? Old behavior: select 1 offset +1 rows; -- ERROR: syntax error at or near "rows" select 1 fetch first +1 rows only; -- works select 1 offset -1 rows; -- ERROR: syntax error at or near "rows" select 1 fetch first -1 rows only; -- ERROR: LIMIT must not be negative New behavior: select 1 offset +1 rows; -- works select 1 fetch first +1 rows only; -- works select 1 offset -1 rows; -- ERROR: OFFSET must not be negative select 1 fetch first -1 rows only; -- ERROR: LIMIT must not be negative -- Andrew (irc:RhodiumToad)
Commits
-
Fix SQL:2008 FETCH FIRST syntax to allow parameters.
- 89b09db01b43 9.3.24 landed
- 769e6fcd1a35 9.4.19 landed
- 3b0fb2529fdf 9.5.14 landed
- 7a0aa8d12ace 9.6.10 landed
- cf516dc9d690 10.5 landed
- 1da162e1f5a7 11.0 landed
-
SQL:2008 alternative syntax for LIMIT/OFFSET:
- 361bfc35724a 8.4.0 cited