diff options
author | Robert Haas <rhaas@postgresql.org> | 2010-07-22 01:22:35 +0000 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2010-07-22 01:22:35 +0000 |
commit | ce68df468a41d8dbb992184aad490c07d02ca721 (patch) | |
tree | 4ec28090880de2036493b915c7fb8c0fdb31ba2a /src/bin/pg_dump/dumputils.c | |
parent | b8c6c71d1c513391975fc107a95f104aeeac3117 (diff) | |
download | postgresql-ce68df468a41d8dbb992184aad490c07d02ca721.tar.gz postgresql-ce68df468a41d8dbb992184aad490c07d02ca721.zip |
Add options to force quoting of all identifiers.
I've added a quote_all_identifiers GUC which affects the behavior
of the backend, and a --quote-all-identifiers argument to pg_dump
and pg_dumpall which sets the GUC and also affects the quoting done
internally by those applications.
Design by Tom Lane; review by Alex Hunsaker; in response to bug #5488
filed by Hartmut Goebel.
Diffstat (limited to 'src/bin/pg_dump/dumputils.c')
-rw-r--r-- | src/bin/pg_dump/dumputils.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/bin/pg_dump/dumputils.c b/src/bin/pg_dump/dumputils.c index 124a4586661..64e5b1df104 100644 --- a/src/bin/pg_dump/dumputils.c +++ b/src/bin/pg_dump/dumputils.c @@ -8,7 +8,7 @@ * Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/bin/pg_dump/dumputils.c,v 1.56 2010/03/03 20:10:48 heikki Exp $ + * $PostgreSQL: pgsql/src/bin/pg_dump/dumputils.c,v 1.57 2010/07/22 01:22:34 rhaas Exp $ * *------------------------------------------------------------------------- */ @@ -36,6 +36,8 @@ static bool parallel_init_done = false; static DWORD tls_index; #endif +int quote_all_identifiers; + void init_parallel_dump_utils(void) { @@ -102,8 +104,10 @@ fmtId(const char *rawid) * These checks need to match the identifier production in scan.l. Don't * use islower() etc. */ + if (quote_all_identifiers) + need_quotes = true; /* slightly different rules for first character */ - if (!((rawid[0] >= 'a' && rawid[0] <= 'z') || rawid[0] == '_')) + else if (!((rawid[0] >= 'a' && rawid[0] <= 'z') || rawid[0] == '_')) need_quotes = true; else { |