88 * Portions Copyright (c) 1996-2009, 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.50 2009/10/07 22:14:24 alvherre Exp $
11+ * $PostgreSQL: pgsql/src/bin/pg_dump/dumputils.c,v 1.51 2009/10/12 23:41:43 tgl Exp $
1212 *
1313 *-------------------------------------------------------------------------
1414 */
@@ -689,7 +689,7 @@ buildACLCommands(const char *name, const char *subname,
689689/*
690690 * Build ALTER DEFAULT PRIVILEGES command(s) for single pg_default_acl entry.
691691 *
692- * type: the object type (as seen in GRANT command )
692+ * type: the object type (TABLES, FUNCTIONS, etc )
693693 * nspname: schema name, or NULL for global default privileges
694694 * acls: the ACL string fetched from the database
695695 * owner: username of privileges owner (will be passed through fmtId)
@@ -803,11 +803,13 @@ do { \
803803 resetPQExpBuffer (privs );
804804 resetPQExpBuffer (privswgo );
805805
806- if (strcmp (type , "TABLE" ) == 0 || strcmp (type , "SEQUENCE" ) == 0 )
806+ if (strcmp (type , "TABLE" ) == 0 || strcmp (type , "SEQUENCE" ) == 0 ||
807+ strcmp (type , "TABLES" ) == 0 || strcmp (type , "SEQUENCES" ) == 0 )
807808 {
808809 CONVERT_PRIV ('r' , "SELECT" );
809810
810- if (strcmp (type , "SEQUENCE" ) == 0 )
811+ if (strcmp (type , "SEQUENCE" ) == 0 ||
812+ strcmp (type , "SEQUENCES" ) == 0 )
811813 /* sequence only */
812814 CONVERT_PRIV ('U' , "USAGE" );
813815 else
@@ -830,13 +832,16 @@ do { \
830832 }
831833
832834 /* UPDATE */
833- if (remoteVersion >= 70200 || strcmp (type , "SEQUENCE" ) == 0 )
835+ if (remoteVersion >= 70200 ||
836+ strcmp (type , "SEQUENCE" ) == 0 ||
837+ strcmp (type , "SEQUENCES" ) == 0 )
834838 CONVERT_PRIV ('w' , "UPDATE" );
835839 else
836840 /* 7.0 and 7.1 have a simpler worldview */
837841 CONVERT_PRIV ('w' , "UPDATE,DELETE" );
838842 }
839- else if (strcmp (type , "FUNCTION" ) == 0 )
843+ else if (strcmp (type , "FUNCTION" ) == 0 ||
844+ strcmp (type , "FUNCTIONS" ) == 0 )
840845 CONVERT_PRIV ('X' , "EXECUTE" );
841846 else if (strcmp (type , "LANGUAGE" ) == 0 )
842847 CONVERT_PRIV ('U' , "USAGE" );
0 commit comments