pgsql: Fix SQL:2008 FETCH FIRST syntax to allow parameters.
pgsql: Fix SQL:2008 FETCH FIRST syntax to allow parameters.
От:
Andrew Gierth <rhodiumtoad@postgresql.org>
Дата:
Fix SQL:2008 FETCH FIRST syntax to allow parameters. OFFSET ROWS FETCH FIRST ROWS ONLY syntax is supposed to accept , which includes parameters as well as literals. When this syntax was added all those years ago, it was done inconsistently, with and being different subsets of the standard syntax. Rectify that by making and accept the same thing, and allowing either a (signed) numeric literal or a c_expr there, which allows for parameters, variables, and parenthesized arbitrary expressions. Per bug #15200 from Lukas Eder. Backpatch all the way, since this has been broken from the start. Discussion: https://postgr.es/m/877enz476l.fsf@news-spur.riddles.org.uk Discussion: http://postgr.es/m/152647780335.27204.16895288237122418685@wrigleys.postgresql.org Branch ------ REL9_6_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/7a0aa8d12ace1e5e73ccf9cbee88fdde255fe172 Modified Files -------------- doc/src/sgml/ref/select.sgml | 14 +++++++------ src/backend/parser/gram.y | 49 +++++++++++++++++++++++++++++--------------- 2 files changed, 41 insertions(+), 22 deletions(-)