8
8
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
9
9
* Portions Copyright (c) 1994, Regents of the University of California
10
10
*
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 $
12
12
*
13
13
*-------------------------------------------------------------------------
14
14
*/
@@ -689,7 +689,7 @@ buildACLCommands(const char *name, const char *subname,
689
689
/*
690
690
* Build ALTER DEFAULT PRIVILEGES command(s) for single pg_default_acl entry.
691
691
*
692
- * type: the object type (as seen in GRANT command )
692
+ * type: the object type (TABLES, FUNCTIONS, etc )
693
693
* nspname: schema name, or NULL for global default privileges
694
694
* acls: the ACL string fetched from the database
695
695
* owner: username of privileges owner (will be passed through fmtId)
@@ -803,11 +803,13 @@ do { \
803
803
resetPQExpBuffer (privs );
804
804
resetPQExpBuffer (privswgo );
805
805
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 )
807
808
{
808
809
CONVERT_PRIV ('r' , "SELECT" );
809
810
810
- if (strcmp (type , "SEQUENCE" ) == 0 )
811
+ if (strcmp (type , "SEQUENCE" ) == 0 ||
812
+ strcmp (type , "SEQUENCES" ) == 0 )
811
813
/* sequence only */
812
814
CONVERT_PRIV ('U' , "USAGE" );
813
815
else
@@ -830,13 +832,16 @@ do { \
830
832
}
831
833
832
834
/* UPDATE */
833
- if (remoteVersion >= 70200 || strcmp (type , "SEQUENCE" ) == 0 )
835
+ if (remoteVersion >= 70200 ||
836
+ strcmp (type , "SEQUENCE" ) == 0 ||
837
+ strcmp (type , "SEQUENCES" ) == 0 )
834
838
CONVERT_PRIV ('w' , "UPDATE" );
835
839
else
836
840
/* 7.0 and 7.1 have a simpler worldview */
837
841
CONVERT_PRIV ('w' , "UPDATE,DELETE" );
838
842
}
839
- else if (strcmp (type , "FUNCTION" ) == 0 )
843
+ else if (strcmp (type , "FUNCTION" ) == 0 ||
844
+ strcmp (type , "FUNCTIONS" ) == 0 )
840
845
CONVERT_PRIV ('X' , "EXECUTE" );
841
846
else if (strcmp (type , "LANGUAGE" ) == 0 )
842
847
CONVERT_PRIV ('U' , "USAGE" );
0 commit comments