DECLARE syntax is different from the 2016 SQL standard

From: elliotchance(at)gmail(dot)com
To: pgsql-docs(at)postgresql(dot)org
Subject: DECLARE syntax is different from the 2016 SQL standard
Date: 2017-03-12 06:09:37
Message-ID: 20170312060937.1416.26045@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/9.1/static/sql-declare.html
Description:

Hi,

The 2016 standard uses a different syntax to declare a cursor:

<declare cursor> ::=
DECLARE <cursor name> <cursor properties>
FOR <cursor specification>

Notice that it does not require or permit the "CURSOR" keyword before the
"FOR" keyword.

I don't know why this was changed and unfortunately fixing this would break
existing implementations, but there should be a note about this under the
SQL Standard section.

This was discovered with: https://github.com/elliotchance/sqltest

BNF for 2016 can be found in the same project:
https://github.com/elliotchance/sqltest/blob/master/standards/2016/bnf.txt#L2371-L2372

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Tom Lane 2017-03-14 02:28:37 Re: DECLARE syntax is different from the 2016 SQL standard
Previous Message mnikulyak 2017-03-11 23:00:31 Excluding common values from the index