Arrange for quote_identifier() and pg_dump to not quote keywords that are
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 18 Jun 2007 21:40:58 +0000 (21:40 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 18 Jun 2007 21:40:58 +0000 (21:40 +0000)
commit4c310eca2eabce72e7346af4a539ed066cbabe3e
tree7f78874c9e9a6abe93a450f34991ba55fec8a43c
parent532834081d9e9d482ff50becab86e014b5f1db30
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.
src/backend/parser/gram.y
src/backend/parser/keywords.c
src/backend/utils/adt/ruleutils.c
src/bin/pg_dump/dumputils.c
src/include/parser/keywords.h
src/test/regress/expected/prepare.out
src/test/regress/expected/rules.out
src/test/regress/expected/xml.out
src/test/regress/expected/xml_1.out
src/test/regress/output/create_function_1.source