summaryrefslogtreecommitdiff
path: root/src/bin/pg_dump/dumputils.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2005-12-03 21:06:18 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2005-12-03 21:06:18 +0000
commite4a9229d5512852c7cb73988644ae39894e8ff1d (patch)
tree1fea57e7e4a2b0ab1e64c3b53dc5b842a8dd66d6 /src/bin/pg_dump/dumputils.c
parent6d4bcda38cf590767768e7f455bd49e8cdd2b27a (diff)
Treat procedural languages as owned by the bootstrap superuser, rather
than owned by nobody. This results in cleaner display of language ACLs, since the backend's aclchk.c uses the same convention. AFAICS there is no practical difference but it's nice to avoid emitting SET SESSION AUTHORIZATION; also this will make it easier to transition pg_dump to some future version in which we may include an explicit ownership column in pg_language. Per gripe from David Begley.
Diffstat (limited to 'src/bin/pg_dump/dumputils.c')
-rw-r--r--src/bin/pg_dump/dumputils.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/bin/pg_dump/dumputils.c b/src/bin/pg_dump/dumputils.c
index 26f6c96f88e..9502b1f16a2 100644
--- a/src/bin/pg_dump/dumputils.c
+++ b/src/bin/pg_dump/dumputils.c
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/bin/pg_dump/dumputils.c,v 1.22 2005/12/02 22:06:07 tgl Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_dump/dumputils.c,v 1.23 2005/12/03 21:06:18 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -328,7 +328,8 @@ parsePGArray(const char *atext, char ***itemarray, int *nitems)
* type: the object type (as seen in GRANT command: must be one of
* TABLE, FUNCTION, LANGUAGE, SCHEMA, DATABASE, or TABLESPACE)
* acls: the ACL string fetched from the database
- * owner: username of object owner (will be passed through fmtId), or NULL
+ * owner: username of object owner (will be passed through fmtId); can be
+ * NULL or empty string to indicate "no owner known"
* remoteVersion: version of database
*
* Returns TRUE if okay, FALSE if could not parse the acl string.
@@ -357,6 +358,10 @@ buildACLCommands(const char *name, const char *type,
if (strlen(acls) == 0)
return true; /* object has default permissions */
+ /* treat empty-string owner same as NULL */
+ if (owner && *owner == '\0')
+ owner = NULL;
+
if (!parsePGArray(acls, &aclitems, &naclitems))
{
if (aclitems)