Commit 47f5bb9f authored by Stephen Frost's avatar Stephen Frost

Correctly dump database and tablespace ACLs

Dump out the appropriate GRANT/REVOKE commands for databases and
tablespaces from pg_dumpall to replicate what the current state is.

This was broken during the changes to buildACLCommands for 9.6+
servers for pg_init_privs.
parent fe03f289
......@@ -2002,6 +2002,9 @@ setup_dictionary(FILE *cmdfd)
* time. This is used by pg_dump to allow users to change privileges
* on catalog objects and to have those privilege changes preserved
* across dump/reload and pg_upgrade.
*
* Note that pg_init_privs is only for per-database objects and therefore
* we don't include databases or tablespaces.
*/
static void
setup_privileges(FILE *cmdfd)
......@@ -2111,30 +2114,6 @@ setup_privileges(FILE *cmdfd)
" (objoid, classoid, objsubid, initprivs, privtype)"
" SELECT"
" oid,"
" (SELECT oid FROM pg_class WHERE relname = 'pg_database'),"
" 0,"
" datacl,"
" 'i'"
" FROM"
" pg_database"
" WHERE"
" datacl IS NOT NULL;",
"INSERT INTO pg_init_privs "
" (objoid, classoid, objsubid, initprivs, privtype)"
" SELECT"
" oid,"
" (SELECT oid FROM pg_class WHERE relname = 'pg_tablespace'),"
" 0,"
" spcacl,"
" 'i'"
" FROM"
" pg_tablespace"
" WHERE"
" spcacl IS NOT NULL;",
"INSERT INTO pg_init_privs "
" (objoid, classoid, objsubid, initprivs, privtype)"
" SELECT"
" oid,"
" (SELECT oid FROM pg_class WHERE "
" relname = 'pg_foreign_data_wrapper'),"
" 0,"
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment