Re: Fix for FETCH FIRST syntax problems
Vik Fearing <vik.fearing@2ndquadrant.com>
From: Vik Fearing <vik.fearing@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>, Andrew Gierth <andrew@tao11.riddles.org.uk>
Cc: pgsql-hackers@postgresql.org
Date: 2018-05-19T23:27:30Z
Lists: pgsql-hackers
On 20/05/18 00:57, Tom Lane wrote: > Andrew Gierth <andrew@tao11.riddles.org.uk> writes: >> Attached is a draft patch for fixing that, which additionally fixes the >> ugly wart that OFFSET <x> ROW/ROWS and FETCH FIRST [<x>] ROW/ROWS ONLY >> had very different productions for <x>; both now accept c_expr there. > > LGTM, except please s/presense/presence/ in grammar comment. > Also, why'd you back off "must write" to "should write" in the docs? > This doesn't make the parens any more optional than before. It certainly does. It allows this now: PREPARE foo AS TABLE bar FETCH FIRST $1 ROWS ONLY; >> I think a case can be made that this should be backpatched; thoughts? > > Meh, -0.5. This is not really a bug, because it's operating as designed. > You've found a reasonably painless way to improve the grammar, which is > great, but it seems more like a feature addition than a bug fix. > > I'd be fine with sneaking this into v11, though. I'm +1 for backpatching it. It may be operating as designed by PeterE ten years ago, but it's not operating as designed by the SQL standard. -- Vik Fearing +33 6 46 75 15 36 http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et Support
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