pgsql: Arrange for quote_identifier() and pg_dump to not quote keywords

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Arrange for quote_identifier() and pg_dump to not quote keywords
Date: 2007-06-18 21:40:58
Message-ID: 20070618214058.E9C1C9FA458@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Log Message:
-----------
Arrange for quote_identifier() and pg_dump to not quote keywords that are
unreserved according to the grammar. The list of unreserved words has gotten
extensive enough that the unnecessary quoting is becoming a bit of an eyesore.
To do this, add knowledge of the keyword category to keywords.c's table.
(Someday we might be able to generate keywords.c's table and the keyword lists
in gram.y from a common source.) For the moment, lie about WITH's status in
the table so it will still get quoted --- this is because of the expectation
that WITH will become reserved when the SQL recursive-queries patch gets done.

I didn't force initdb because this affects nothing on-disk; but note that a
few regression tests have changed expected output.

Modified Files:
--------------
pgsql/src/backend/parser:
gram.y (r2.594 -> r2.595)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/parser/gram.y.diff?r1=2.594&r2=2.595)
keywords.c (r1.188 -> r1.189)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/parser/keywords.c.diff?r1=1.188&r2=1.189)
pgsql/src/backend/utils/adt:
ruleutils.c (r1.261 -> r1.262)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/ruleutils.c.diff?r1=1.261&r2=1.262)
pgsql/src/bin/pg_dump:
dumputils.c (r1.35 -> r1.36)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/bin/pg_dump/dumputils.c.diff?r1=1.35&r2=1.36)
pgsql/src/include/parser:
keywords.h (r1.22 -> r1.23)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/parser/keywords.h.diff?r1=1.22&r2=1.23)
pgsql/src/test/regress/expected:
prepare.out (r1.14 -> r1.15)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/prepare.out.diff?r1=1.14&r2=1.15)
rules.out (r1.128 -> r1.129)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/rules.out.diff?r1=1.128&r2=1.129)
xml.out (r1.18 -> r1.19)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/xml.out.diff?r1=1.18&r2=1.19)
xml_1.out (r1.17 -> r1.18)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/xml_1.out.diff?r1=1.17&r2=1.18)
pgsql/src/test/regress/output:
create_function_1.source (r1.29 -> r1.30)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/output/create_function_1.source.diff?r1=1.29&r2=1.30)

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message User Pgunittest 2007-06-19 17:53:35 pgunittest - GeneratorParser: New Directory
Previous Message User Mkz 2007-06-18 14:41:14 plproxy - plproxy: include debian/packages in tgz

Browse pgsql-hackers by date

  From Date Subject
Next Message Gregory Stark 2007-06-18 21:45:25 Re: Reducing NUMERIC size for 8.3
Previous Message Tom Lane 2007-06-18 21:27:13 Re: Reducing NUMERIC size for 8.3