Thread: pgsql: Make OFF keyword unreserved. It's not hard to imagine wanting to

pgsql: Make OFF keyword unreserved. It's not hard to imagine wanting to

From
Heikki Linnakangas
Date:
Make OFF keyword unreserved. It's not hard to imagine wanting to use 'off'
as a variable or column name, and it's not reserved in recent versions of
the SQL spec either. This became particularly annoying in 9.0, before that
PL/pgSQL replaced variable names in queries with parameter markers, so
it was possible to use OFF and many other backend parser keywords as
variable names. Because of that, backpatch to 9.0.

Branch
------
master

Details
-------
http://git.postgresql.org/gitweb?p=postgresql.git;a=commitdiff;h=5c84fe4607907b22e45433195fec800d23ac1f49

Modified Files
--------------
src/backend/parser/gram.y   |   26 +++++++++++++-------------
src/include/parser/kwlist.h |    2 +-
2 files changed, 14 insertions(+), 14 deletions(-)


Heikki Linnakangas <heikki.linnakangas@iki.fi> writes:
> Make OFF keyword unreserved.

Two comments:

* You forgot a semicolon here:

+           | ColId_or_Sconst                       { $$ = $1 }
should be
+           | ColId_or_Sconst                       { $$ = $1; }

I think this will work as-is in some versions of bison, but not all.

* The SGML documentation keyword appendix needs an update too, no?

            regards, tom lane

Re: pgsql: Make OFF keyword unreserved. It's not hard to imagine wanting to

From
Heikki Linnakangas
Date:
On 22.10.2010 18:10, Tom Lane wrote:
> * You forgot a semicolon here:
>
> +           | ColId_or_Sconst                       { $$ = $1 }
> should be
> +           | ColId_or_Sconst                       { $$ = $1; }
>
> I think this will work as-is in some versions of bison, but not all.

Ah yes, it worked for me.

> * The SGML documentation keyword appendix needs an update too, no?

Hmm, I thought the list is automatically updated, but apparently not.

Thanks, fixed.

--
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com

Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> writes:
> On 22.10.2010 18:10, Tom Lane wrote:
>> * The SGML documentation keyword appendix needs an update too, no?

> Hmm, I thought the list is automatically updated, but apparently not.

I think Peter has some script he runs at release time to update it,
but he wouldn't be very likely to think to re-update 9.0.  So a manual
patch seems required.

            regards, tom lane