summaryrefslogtreecommitdiff
path: root/src/backend/parser/gram.y
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2007-06-18 21:40:58 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2007-06-18 21:40:58 +0000
commit4c310eca2eabce72e7346af4a539ed066cbabe3e (patch)
tree7f78874c9e9a6abe93a450f34991ba55fec8a43c /src/backend/parser/gram.y
parent532834081d9e9d482ff50becab86e014b5f1db30 (diff)
downloadpostgresql-4c310eca2eabce72e7346af4a539ed066cbabe3e.tar.gz
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.
Diffstat (limited to 'src/backend/parser/gram.y')
-rw-r--r--src/backend/parser/gram.y8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y
index 8ec562c5e3..6e894c1799 100644
--- a/src/backend/parser/gram.y
+++ b/src/backend/parser/gram.y
@@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.594 2007/06/15 20:56:49 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.595 2007/06/18 21:40:57 tgl Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
@@ -8787,12 +8787,16 @@ ColLabel: IDENT { $$ = $1; }
/*
- * Keyword classification lists. Generally, every keyword present in
+ * Keyword category lists. Generally, every keyword present in
* the Postgres grammar should appear in exactly one of these lists.
*
* Put a new keyword into the first list that it can go into without causing
* shift or reduce conflicts. The earlier lists define "less reserved"
* categories of keywords.
+ *
+ * Make sure that each keyword's category in keywords.c matches where
+ * it is listed here. (Someday we may be able to generate these lists and
+ * keywords.c's table from a common master list.)
*/
/* "Unreserved" keywords --- available for use as any kind of name.