aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/pg_upgrade_support.c
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/backend/utils/adt/pg_upgrade_support.c
parentd217b2c360cb9a746b4ef122c568bdfedb6d726e (diff)
downloadpostgresql-23f34fa4ba358671adab16773e79c17c92cbc870.tar.gz
postgresql-23f34fa4ba358671adab16773e79c17c92cbc870.zip
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/backend/utils/adt/pg_upgrade_support.c')
-rw-r--r--src/backend/utils/adt/pg_upgrade_support.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/backend/utils/adt/pg_upgrade_support.c b/src/backend/utils/adt/pg_upgrade_support.c
index 912eadaf369..6ff035ace30 100644
--- a/src/backend/utils/adt/pg_upgrade_support.c
+++ b/src/backend/utils/adt/pg_upgrade_support.c
@@ -29,6 +29,7 @@ Datum binary_upgrade_set_next_toast_pg_class_oid(PG_FUNCTION_ARGS);
Datum binary_upgrade_set_next_pg_enum_oid(PG_FUNCTION_ARGS);
Datum binary_upgrade_set_next_pg_authid_oid(PG_FUNCTION_ARGS);
Datum binary_upgrade_create_empty_extension(PG_FUNCTION_ARGS);
+Datum binary_upgrade_set_record_init_privs(PG_FUNCTION_ARGS);
#define CHECK_IS_BINARY_UPGRADE \
@@ -193,3 +194,14 @@ binary_upgrade_create_empty_extension(PG_FUNCTION_ARGS)
PG_RETURN_VOID();
}
+
+Datum
+binary_upgrade_set_record_init_privs(PG_FUNCTION_ARGS)
+{
+ bool record_init_privs = PG_GETARG_BOOL(0);
+
+ CHECK_IS_BINARY_UPGRADE;
+ binary_upgrade_record_init_privs = record_init_privs;
+
+ PG_RETURN_VOID();
+}