summaryrefslogtreecommitdiff
path: root/src/bin/pg_dump/dumputils.h
diff options
context:
space:
mode:
authorStephen Frost <sfrost@snowman.net>2016-04-06 21:45:32 -0400
committerStephen Frost <sfrost@snowman.net>2016-04-06 21:45:32 -0400
commit23f34fa4ba358671adab16773e79c17c92cbc870 (patch)
treef1f1cef2eb727f70ba5a48bc0d89b54b5d7c3019 /src/bin/pg_dump/dumputils.h
parentd217b2c360cb9a746b4ef122c568bdfedb6d726e (diff)
In pg_dump, include pg_catalog and extension ACLs, if changed
Now that all of the infrastructure exists, add in the ability to dump out the ACLs of the objects inside of pg_catalog or the ACLs for objects which are members of extensions, but only if they have been changed from their original values. The original values are tracked in pg_init_privs. When pg_dump'ing 9.6-and-above databases, we will dump out the ACLs for all objects in pg_catalog and the ACLs for all extension members, where the ACL has been changed from the original value which was set during either initdb or CREATE EXTENSION. This should not change dumps against pre-9.6 databases. Reviews by Alexander Korotkov, Jose Luis Tallon
Diffstat (limited to 'src/bin/pg_dump/dumputils.h')
-rw-r--r--src/bin/pg_dump/dumputils.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/bin/pg_dump/dumputils.h b/src/bin/pg_dump/dumputils.h
index 4b404be99a9..b2fd7d37d0c 100644
--- a/src/bin/pg_dump/dumputils.h
+++ b/src/bin/pg_dump/dumputils.h
@@ -37,8 +37,8 @@
extern bool buildACLCommands(const char *name, const char *subname,
- const char *type, const char *acls, const char *owner,
- const char *prefix, int remoteVersion,
+ const char *type, const char *acls, const char *racls,
+ const char *owner, const char *prefix, int remoteVersion,
PQExpBuffer sql);
extern bool buildDefaultACLCommands(const char *type, const char *nspname,
const char *acls, const char *owner,
@@ -49,4 +49,9 @@ extern void buildShSecLabelQuery(PGconn *conn, const char *catalog_name,
extern void emitShSecLabels(PGconn *conn, PGresult *res,
PQExpBuffer buffer, const char *target, const char *objname);
+extern void buildACLQueries(PQExpBuffer acl_subquery, PQExpBuffer racl_subquery,
+ PQExpBuffer init_acl_subquery, PQExpBuffer init_racl_subquery,
+ const char *acl_column, const char *acl_owner,
+ const char *obj_kind, bool binary_upgrade);
+
#endif /* DUMPUTILS_H */