Обсуждение: pgsql: Arrange for quote_identifier() and pg_dump to not quote keywords

Поиск
Список
Период
Сортировка

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

От
tgl@postgresql.org (Tom Lane)
Дата:
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)