diff options
author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2009-10-07 22:14:26 +0000 |
---|---|---|
committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2009-10-07 22:14:26 +0000 |
commit | 2eda8dfb52ed9962920282d8384da8bb4c22514d (patch) | |
tree | a89217bd461bda210a8ebaab0cef924cac53d863 /src/bin/pg_dump/dumputils.c | |
parent | 07cefdfb7a1c1a7ae96783c9723102250a4c3bad (diff) | |
download | postgresql-2eda8dfb52ed9962920282d8384da8bb4c22514d.tar.gz postgresql-2eda8dfb52ed9962920282d8384da8bb4c22514d.zip |
Make it possibly to specify GUC params per user and per database.
Create a new catalog pg_db_role_setting where they are now stored, and better
encapsulate the code that deals with settings into its realm. The old
datconfig and rolconfig columns are removed.
psql has gained a \drds command to display the settings.
Backwards compatibility warning: while the backwards-compatible system views
still have the config columns, they no longer completely represent the
configuration for a user or database.
Catalog version bumped.
Diffstat (limited to 'src/bin/pg_dump/dumputils.c')
-rw-r--r-- | src/bin/pg_dump/dumputils.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/bin/pg_dump/dumputils.c b/src/bin/pg_dump/dumputils.c index a9a27625707..f8aa9e64b91 100644 --- a/src/bin/pg_dump/dumputils.c +++ b/src/bin/pg_dump/dumputils.c @@ -8,7 +8,7 @@ * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/bin/pg_dump/dumputils.c,v 1.49 2009/10/05 19:24:45 tgl Exp $ + * $PostgreSQL: pgsql/src/bin/pg_dump/dumputils.c,v 1.50 2009/10/07 22:14:24 alvherre Exp $ * *------------------------------------------------------------------------- */ @@ -942,7 +942,8 @@ AddAcl(PQExpBuffer aclbuf, const char *keyword, const char *subname) * * Scan a wildcard-pattern string and generate appropriate WHERE clauses * to limit the set of objects returned. The WHERE clauses are appended - * to the already-partially-constructed query in buf. + * to the already-partially-constructed query in buf. Returns whether + * any clause was added. * * conn: connection query will be sent to (consulted for escaping rules). * buf: output parameter. @@ -961,7 +962,7 @@ AddAcl(PQExpBuffer aclbuf, const char *keyword, const char *subname) * Formatting note: the text already present in buf should end with a newline. * The appended text, if any, will end with one too. */ -void +bool processSQLNamePattern(PGconn *conn, PQExpBuffer buf, const char *pattern, bool have_where, bool force_escape, const char *schemavar, const char *namevar, @@ -973,9 +974,11 @@ processSQLNamePattern(PGconn *conn, PQExpBuffer buf, const char *pattern, bool inquotes; const char *cp; int i; + bool added_clause = false; #define WHEREAND() \ - (appendPQExpBufferStr(buf, have_where ? " AND " : "WHERE "), have_where = true) + (appendPQExpBufferStr(buf, have_where ? " AND " : "WHERE "), \ + have_where = true, added_clause = true) if (pattern == NULL) { @@ -985,7 +988,7 @@ processSQLNamePattern(PGconn *conn, PQExpBuffer buf, const char *pattern, WHEREAND(); appendPQExpBuffer(buf, "%s\n", visibilityrule); } - return; + return added_clause; } initPQExpBuffer(&schemabuf); @@ -1142,5 +1145,6 @@ processSQLNamePattern(PGconn *conn, PQExpBuffer buf, const char *pattern, termPQExpBuffer(&schemabuf); termPQExpBuffer(&namebuf); + return added_clause; #undef WHEREAND } |