summaryrefslogtreecommitdiff
path: root/src/bin/pg_dump/dumputils.c
diff options
context:
space:
mode:
authorTom Lane2009-10-12 23:41:45 +0000
committerTom Lane2009-10-12 23:41:45 +0000
commit5ec1341136941b538d07f54b2a6d7554857f8dc3 (patch)
treeed2a54279fe65ce16af4e9e4f60e8822caee6c04 /src/bin/pg_dump/dumputils.c
parent11ca04b4b71dd5bebafc97eefe96614873158f87 (diff)
Use plurals (TABLES, FUNCTIONS, etc) in ALTER DEFAULT PRIVILEGES. We have
the keywords as a consequence of the GRANT ALL patch, so we might as well use them and make the ALTER commands read more naturally.
Diffstat (limited to 'src/bin/pg_dump/dumputils.c')
-rw-r--r--src/bin/pg_dump/dumputils.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/bin/pg_dump/dumputils.c b/src/bin/pg_dump/dumputils.c
index f8aa9e64b91..c7cfa2a6212 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.50 2009/10/07 22:14:24 alvherre Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_dump/dumputils.c,v 1.51 2009/10/12 23:41:43 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -689,7 +689,7 @@ buildACLCommands(const char *name, const char *subname,
/*
* Build ALTER DEFAULT PRIVILEGES command(s) for single pg_default_acl entry.
*
- * type: the object type (as seen in GRANT command)
+ * type: the object type (TABLES, FUNCTIONS, etc)
* nspname: schema name, or NULL for global default privileges
* acls: the ACL string fetched from the database
* owner: username of privileges owner (will be passed through fmtId)
@@ -803,11 +803,13 @@ do { \
resetPQExpBuffer(privs);
resetPQExpBuffer(privswgo);
- if (strcmp(type, "TABLE") == 0 || strcmp(type, "SEQUENCE") == 0)
+ if (strcmp(type, "TABLE") == 0 || strcmp(type, "SEQUENCE") == 0 ||
+ strcmp(type, "TABLES") == 0 || strcmp(type, "SEQUENCES") == 0)
{
CONVERT_PRIV('r', "SELECT");
- if (strcmp(type, "SEQUENCE") == 0)
+ if (strcmp(type, "SEQUENCE") == 0 ||
+ strcmp(type, "SEQUENCES") == 0)
/* sequence only */
CONVERT_PRIV('U', "USAGE");
else
@@ -830,13 +832,16 @@ do { \
}
/* UPDATE */
- if (remoteVersion >= 70200 || strcmp(type, "SEQUENCE") == 0)
+ if (remoteVersion >= 70200 ||
+ strcmp(type, "SEQUENCE") == 0 ||
+ strcmp(type, "SEQUENCES") == 0)
CONVERT_PRIV('w', "UPDATE");
else
/* 7.0 and 7.1 have a simpler worldview */
CONVERT_PRIV('w', "UPDATE,DELETE");
}
- else if (strcmp(type, "FUNCTION") == 0)
+ else if (strcmp(type, "FUNCTION") == 0 ||
+ strcmp(type, "FUNCTIONS") == 0)
CONVERT_PRIV('X', "EXECUTE");
else if (strcmp(type, "LANGUAGE") == 0)
CONVERT_PRIV('U', "USAGE");