Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 3491520

Browse files
committed
Code review for --quote-all-identifiers patch: add missing --help documentation
for new pg_dump/pg_dumpall parameters, make a couple of trivial stylistic adjustments to make the code follow usual project style.
1 parent e20df55 commit 3491520

File tree

5 files changed

+15
-10
lines changed

5 files changed

+15
-10
lines changed

src/backend/utils/adt/ruleutils.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
*
1111
* IDENTIFICATION
12-
* $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.329 2010/07/22 01:22:33 rhaas Exp $
12+
* $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.330 2010/08/03 19:24:04 tgl Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -132,7 +132,9 @@ static SPIPlanPtr plan_getrulebyoid = NULL;
132132
static const char *query_getrulebyoid = "SELECT * FROM pg_catalog.pg_rewrite WHERE oid = $1";
133133
static SPIPlanPtr plan_getviewrule = NULL;
134134
static const char *query_getviewrule = "SELECT * FROM pg_catalog.pg_rewrite WHERE ev_class = $1 AND rulename = $2";
135-
bool quote_all_identifiers;
135+
136+
/* GUC parameters */
137+
bool quote_all_identifiers = false;
136138

137139

138140
/* ----------

src/bin/pg_dump/dumputils.c

+4-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
99
* Portions Copyright (c) 1994, Regents of the University of California
1010
*
11-
* $PostgreSQL: pgsql/src/bin/pg_dump/dumputils.c,v 1.57 2010/07/22 01:22:34 rhaas Exp $
11+
* $PostgreSQL: pgsql/src/bin/pg_dump/dumputils.c,v 1.58 2010/08/03 19:24:04 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -21,6 +21,9 @@
2121
#include "parser/keywords.h"
2222

2323

24+
int quote_all_identifiers = 0;
25+
26+
2427
#define supports_grant_options(version) ((version) >= 70400)
2528

2629
static bool parseAclItem(const char *item, const char *type,
@@ -36,8 +39,6 @@ static bool parallel_init_done = false;
3639
static DWORD tls_index;
3740
#endif
3841

39-
int quote_all_identifiers;
40-
4142
void
4243
init_parallel_dump_utils(void)
4344
{

src/bin/pg_dump/dumputils.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
99
* Portions Copyright (c) 1994, Regents of the University of California
1010
*
11-
* $PostgreSQL: pgsql/src/bin/pg_dump/dumputils.h,v 1.30 2010/07/22 01:22:34 rhaas Exp $
11+
* $PostgreSQL: pgsql/src/bin/pg_dump/dumputils.h,v 1.31 2010/08/03 19:24:04 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -19,6 +19,8 @@
1919
#include "libpq-fe.h"
2020
#include "pqexpbuffer.h"
2121

22+
extern int quote_all_identifiers;
23+
2224
extern void init_parallel_dump_utils(void);
2325
extern const char *fmtId(const char *identifier);
2426
extern void appendStringLiteral(PQExpBuffer buf, const char *str,
@@ -46,6 +48,4 @@ extern bool processSQLNamePattern(PGconn *conn, PQExpBuffer buf,
4648
const char *schemavar, const char *namevar,
4749
const char *altnamevar, const char *visibilityrule);
4850

49-
extern int quote_all_identifiers;
50-
5151
#endif /* DUMPUTILS_H */

src/bin/pg_dump/pg_dump.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
* http://archives.postgresql.org/pgsql-bugs/2010-02/msg00187.php
2626
*
2727
* IDENTIFICATION
28-
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.583 2010/07/22 01:22:34 rhaas Exp $
28+
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.584 2010/08/03 19:24:04 tgl Exp $
2929
*
3030
*-------------------------------------------------------------------------
3131
*/
@@ -836,6 +836,7 @@ help(const char *progname)
836836
printf(_(" --disable-dollar-quoting disable dollar quoting, use SQL standard quoting\n"));
837837
printf(_(" --disable-triggers disable triggers during data-only restore\n"));
838838
printf(_(" --no-tablespaces do not dump tablespace assignments\n"));
839+
printf(_(" --quote-all-identifiers quote all identifiers, even if not keywords\n"));
839840
printf(_(" --role=ROLENAME do SET ROLE before dump\n"));
840841
printf(_(" --use-set-session-authorization\n"
841842
" use SET SESSION AUTHORIZATION commands instead of\n"

src/bin/pg_dump/pg_dumpall.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1994, Regents of the University of California
77
*
88
*
9-
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.136 2010/07/22 01:25:01 rhaas Exp $
9+
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.137 2010/08/03 19:24:05 tgl Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -564,6 +564,7 @@ help(void)
564564
printf(_(" --disable-dollar-quoting disable dollar quoting, use SQL standard quoting\n"));
565565
printf(_(" --disable-triggers disable triggers during data-only restore\n"));
566566
printf(_(" --no-tablespaces do not dump tablespace assignments\n"));
567+
printf(_(" --quote-all-identifiers quote all identifiers, even if not keywords\n"));
567568
printf(_(" --role=ROLENAME do SET ROLE before dump\n"));
568569
printf(_(" --use-set-session-authorization\n"
569570
" use SET SESSION AUTHORIZATION commands instead of\n"

0 commit comments

Comments
 (0)