1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-05 07:21:24 +03:00

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.
This commit is contained in:
Tom Lane
2005-12-03 21:06:18 +00:00
parent 6d4bcda38c
commit e4a9229d55
3 changed files with 54 additions and 23 deletions

View File

@ -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)