diff options
| author | Stephen Frost | 2016-04-07 01:45:32 +0000 |
|---|---|---|
| committer | Stephen Frost | 2016-04-07 01:45:32 +0000 |
| commit | 23f34fa4ba358671adab16773e79c17c92cbc870 (patch) | |
| tree | f1f1cef2eb727f70ba5a48bc0d89b54b5d7c3019 /src/test | |
| parent | d217b2c360cb9a746b4ef122c568bdfedb6d726e (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/test')
| -rw-r--r-- | src/test/regress/expected/init_privs.out | 13 | ||||
| -rw-r--r-- | src/test/regress/parallel_schedule | 2 | ||||
| -rw-r--r-- | src/test/regress/serial_schedule | 1 | ||||
| -rw-r--r-- | src/test/regress/sql/init_privs.sql | 11 |
4 files changed, 26 insertions, 1 deletions
diff --git a/src/test/regress/expected/init_privs.out b/src/test/regress/expected/init_privs.out new file mode 100644 index 00000000000..980940fa67f --- /dev/null +++ b/src/test/regress/expected/init_privs.out @@ -0,0 +1,13 @@ +-- Test iniital privileges +-- There should always be some initial privileges, set up by initdb +SELECT count(*) > 0 FROM pg_init_privs; + ?column? +---------- + t +(1 row) + +CREATE ROLE init_privs_test_role1; +CREATE ROLE init_privs_test_role2; +-- Intentionally include some non-initial privs for pg_dump to dump out +GRANT SELECT ON pg_proc TO init_privs_test_role1; +GRANT SELECT (prosrc) ON pg_proc TO init_privs_test_role2; diff --git a/src/test/regress/parallel_schedule b/src/test/regress/parallel_schedule index 7c7b58d43d9..6c1f21bb627 100644 --- a/src/test/regress/parallel_schedule +++ b/src/test/regress/parallel_schedule @@ -84,7 +84,7 @@ test: select_into select_distinct select_distinct_on select_implicit select_havi # ---------- # Another group of parallel tests # ---------- -test: brin gin gist spgist privileges security_label collate matview lock replica_identity rowsecurity object_address tablesample groupingsets drop_operator +test: brin gin gist spgist privileges init_privs security_label collate matview lock replica_identity rowsecurity object_address tablesample groupingsets drop_operator # ---------- # Another group of parallel tests diff --git a/src/test/regress/serial_schedule b/src/test/regress/serial_schedule index 1b66516a13f..8269c524dc6 100644 --- a/src/test/regress/serial_schedule +++ b/src/test/regress/serial_schedule @@ -105,6 +105,7 @@ test: gin test: gist test: spgist test: privileges +test: init_privs test: security_label test: collate test: matview diff --git a/src/test/regress/sql/init_privs.sql b/src/test/regress/sql/init_privs.sql new file mode 100644 index 00000000000..38d4a885389 --- /dev/null +++ b/src/test/regress/sql/init_privs.sql @@ -0,0 +1,11 @@ +-- Test iniital privileges + +-- There should always be some initial privileges, set up by initdb +SELECT count(*) > 0 FROM pg_init_privs; + +CREATE ROLE init_privs_test_role1; +CREATE ROLE init_privs_test_role2; + +-- Intentionally include some non-initial privs for pg_dump to dump out +GRANT SELECT ON pg_proc TO init_privs_test_role1; +GRANT SELECT (prosrc) ON pg_proc TO init_privs_test_role2; |
