/*
* Get all tablespaces except built-in ones (which we assume are named
* pg_xxx)
+ *
+ * For the tablespace ACLs, as of 9.6, we extract both the positive (as
+ * spcacl) and negative (as rspcacl) ACLs, relative to the default ACL for
+ * tablespaces, which are then passed to buildACLCommands() below.
+ *
+ * See buildACLQueries() and buildACLCommands().
+ *
+ * Note that we do not support initial privileges (pg_init_privs) on
+ * tablespaces.
*/
- if (server_version >= 90200)
+ if (server_version >= 90600)
res = executeQuery(conn, "SELECT oid, spcname, "
"pg_catalog.pg_get_userbyid(spcowner) AS spcowner, "
- "pg_catalog.pg_tablespace_location(oid), spcacl, "
+ "pg_catalog.pg_tablespace_location(oid), "
+ "(SELECT pg_catalog.array_agg(acl) FROM (SELECT pg_catalog.unnest(coalesce(spcacl,pg_catalog.acldefault('t',spcowner))) AS acl "
+ "EXCEPT SELECT pg_catalog.unnest(pg_catalog.acldefault('t',spcowner))) as foo)"
+ "AS spcacl,"
+ "(SELECT pg_catalog.array_agg(acl) FROM (SELECT pg_catalog.unnest(pg_catalog.acldefault('t',spcowner)) AS acl "
+ "EXCEPT SELECT pg_catalog.unnest(coalesce(spcacl,pg_catalog.acldefault('t',spcowner)))) as foo)"
+ "AS rspcacl,"
+ "array_to_string(spcoptions, ', '),"
+ "pg_catalog.shobj_description(oid, 'pg_tablespace') "
+ "FROM pg_catalog.pg_tablespace "
+ "WHERE spcname !~ '^pg_' "
+ "ORDER BY 1");
+ else if (server_version >= 90200)
+ res = executeQuery(conn, "SELECT oid, spcname, "
+ "pg_catalog.pg_get_userbyid(spcowner) AS spcowner, "
+ "pg_catalog.pg_tablespace_location(oid), spcacl, '' as rspcacl, "
"array_to_string(spcoptions, ', '),"
"pg_catalog.shobj_description(oid, 'pg_tablespace') "
"FROM pg_catalog.pg_tablespace "
else if (server_version >= 90000)
res = executeQuery(conn, "SELECT oid, spcname, "
"pg_catalog.pg_get_userbyid(spcowner) AS spcowner, "
- "spclocation, spcacl, "
+ "spclocation, spcacl, '' as rspcacl, "
"array_to_string(spcoptions, ', '),"
"pg_catalog.shobj_description(oid, 'pg_tablespace') "
"FROM pg_catalog.pg_tablespace "
else if (server_version >= 80200)
res = executeQuery(conn, "SELECT oid, spcname, "
"pg_catalog.pg_get_userbyid(spcowner) AS spcowner, "
- "spclocation, spcacl, null, "
+ "spclocation, spcacl, '' as rspcacl, null, "
"pg_catalog.shobj_description(oid, 'pg_tablespace') "
"FROM pg_catalog.pg_tablespace "
"WHERE spcname !~ '^pg_' "
else
res = executeQuery(conn, "SELECT oid, spcname, "
"pg_catalog.pg_get_userbyid(spcowner) AS spcowner, "
- "spclocation, spcacl, "
+ "spclocation, spcacl, '' as rspcacl, "
"null, null "
"FROM pg_catalog.pg_tablespace "
"WHERE spcname !~ '^pg_' "
char *spcowner = PQgetvalue(res, i, 2);
char *spclocation = PQgetvalue(res, i, 3);
char *spcacl = PQgetvalue(res, i, 4);
- char *spcoptions = PQgetvalue(res, i, 5);
- char *spccomment = PQgetvalue(res, i, 6);
+ char *rspcacl = PQgetvalue(res, i, 5);
+ char *spcoptions = PQgetvalue(res, i, 6);
+ char *spccomment = PQgetvalue(res, i, 7);
char *fspcname;
/* needed for buildACLCommands() */
fspcname, spcoptions);
if (!skip_acls &&
- !buildACLCommands(fspcname, NULL, "TABLESPACE", spcacl, "",
+ !buildACLCommands(fspcname, NULL, "TABLESPACE", spcacl, rspcacl,
spcowner, "", server_version, buf))
{
fprintf(stderr, _("%s: could not parse ACL list (%s) for tablespace \"%s\"\n"),
PQclear(res);
- /* Now collect all the information about databases to dump */
- if (server_version >= 90300)
+
+ /*
+ * Now collect all the information about databases to dump.
+ *
+ * For the database ACLs, as of 9.6, we extract both the positive (as
+ * datacl) and negative (as rdatacl) ACLs, relative to the default ACL for
+ * databases, which are then passed to buildACLCommands() below.
+ *
+ * See buildACLQueries() and buildACLCommands().
+ *
+ * Note that we do not support initial privileges (pg_init_privs) on
+ * databases.
+ */
+ if (server_version >= 90600)
+ res = executeQuery(conn,
+ "SELECT datname, "
+ "coalesce(rolname, (select rolname from pg_authid where oid=(select datdba from pg_database where datname='template0'))), "
+ "pg_encoding_to_char(d.encoding), "
+ "datcollate, datctype, datfrozenxid, datminmxid, "
+ "datistemplate, "
+ "(SELECT pg_catalog.array_agg(acl) FROM (SELECT pg_catalog.unnest(coalesce(datacl,pg_catalog.acldefault('d',datdba))) AS acl "
+ "EXCEPT SELECT pg_catalog.unnest(pg_catalog.acldefault('d',datdba))) as foo)"
+ "AS datacl,"
+ "(SELECT pg_catalog.array_agg(acl) FROM (SELECT pg_catalog.unnest(pg_catalog.acldefault('d',datdba)) AS acl "
+ "EXCEPT SELECT pg_catalog.unnest(coalesce(datacl,pg_catalog.acldefault('d',datdba)))) as foo)"
+ "AS rdatacl,"
+ "datconnlimit, "
+ "(SELECT spcname FROM pg_tablespace t WHERE t.oid = d.dattablespace) AS dattablespace "
+ "FROM pg_database d LEFT JOIN pg_authid u ON (datdba = u.oid) "
+ "WHERE datallowconn ORDER BY 1");
+ else if (server_version >= 90300)
res = executeQuery(conn,
"SELECT datname, "
"coalesce(rolname, (select rolname from pg_authid where oid=(select datdba from pg_database where datname='template0'))), "
"pg_encoding_to_char(d.encoding), "
"datcollate, datctype, datfrozenxid, datminmxid, "
- "datistemplate, datacl, datconnlimit, "
+ "datistemplate, datacl, '' as rdatacl, datconnlimit, "
"(SELECT spcname FROM pg_tablespace t WHERE t.oid = d.dattablespace) AS dattablespace "
"FROM pg_database d LEFT JOIN pg_authid u ON (datdba = u.oid) "
"WHERE datallowconn ORDER BY 1");
"coalesce(rolname, (select rolname from pg_authid where oid=(select datdba from pg_database where datname='template0'))), "
"pg_encoding_to_char(d.encoding), "
"datcollate, datctype, datfrozenxid, 0 AS datminmxid, "
- "datistemplate, datacl, datconnlimit, "
+ "datistemplate, datacl, '' as rdatacl, datconnlimit, "
"(SELECT spcname FROM pg_tablespace t WHERE t.oid = d.dattablespace) AS dattablespace "
"FROM pg_database d LEFT JOIN pg_authid u ON (datdba = u.oid) "
"WHERE datallowconn ORDER BY 1");
"coalesce(rolname, (select rolname from pg_authid where oid=(select datdba from pg_database where datname='template0'))), "
"pg_encoding_to_char(d.encoding), "
"null::text AS datcollate, null::text AS datctype, datfrozenxid, 0 AS datminmxid, "
- "datistemplate, datacl, datconnlimit, "
+ "datistemplate, datacl, '' as rdatacl, datconnlimit, "
"(SELECT spcname FROM pg_tablespace t WHERE t.oid = d.dattablespace) AS dattablespace "
"FROM pg_database d LEFT JOIN pg_authid u ON (datdba = u.oid) "
"WHERE datallowconn ORDER BY 1");
"coalesce(usename, (select usename from pg_shadow where usesysid=(select datdba from pg_database where datname='template0'))), "
"pg_encoding_to_char(d.encoding), "
"null::text AS datcollate, null::text AS datctype, datfrozenxid, 0 AS datminmxid, "
- "datistemplate, datacl, -1 as datconnlimit, "
+ "datistemplate, datacl, '' as rdatacl, -1 as datconnlimit, "
"(SELECT spcname FROM pg_tablespace t WHERE t.oid = d.dattablespace) AS dattablespace "
"FROM pg_database d LEFT JOIN pg_shadow u ON (datdba = usesysid) "
"WHERE datallowconn ORDER BY 1");
"coalesce(usename, (select usename from pg_shadow where usesysid=(select datdba from pg_database where datname='template0'))), "
"pg_encoding_to_char(d.encoding), "
"null::text AS datcollate, null::text AS datctype, datfrozenxid, 0 AS datminmxid, "
- "datistemplate, datacl, -1 as datconnlimit, "
+ "datistemplate, datacl, '' as rdatacl, -1 as datconnlimit, "
"'pg_default' AS dattablespace "
"FROM pg_database d LEFT JOIN pg_shadow u ON (datdba = usesysid) "
"WHERE datallowconn ORDER BY 1");
"(select usename from pg_shadow where usesysid=(select datdba from pg_database where datname='template0'))), "
"pg_encoding_to_char(d.encoding), "
"null::text AS datcollate, null::text AS datctype, 0 AS datfrozenxid, 0 AS datminmxid, "
- "datistemplate, '' as datacl, -1 as datconnlimit, "
+ "datistemplate, '' as datacl, '' as rdatacl, -1 as datconnlimit, "
"'pg_default' AS dattablespace "
"FROM pg_database d "
"WHERE datallowconn ORDER BY 1");
"pg_encoding_to_char(d.encoding), "
"null::text AS datcollate, null::text AS datctype, 0 AS datfrozenxid, 0 AS datminmxid, "
"'f' as datistemplate, "
- "'' as datacl, -1 as datconnlimit, "
+ "'' as datacl, '' as rdatacl, -1 as datconnlimit, "
"'pg_default' AS dattablespace "
"FROM pg_database d "
"ORDER BY 1");
uint32 dbminmxid = atooid(PQgetvalue(res, i, 6));
char *dbistemplate = PQgetvalue(res, i, 7);
char *dbacl = PQgetvalue(res, i, 8);
- char *dbconnlimit = PQgetvalue(res, i, 9);
- char *dbtablespace = PQgetvalue(res, i, 10);
+ char *rdbacl = PQgetvalue(res, i, 9);
+ char *dbconnlimit = PQgetvalue(res, i, 10);
+ char *dbtablespace = PQgetvalue(res, i, 11);
char *fdbname;
fdbname = pg_strdup(fmtId(dbname));
}
if (!skip_acls &&
- !buildACLCommands(fdbname, NULL, "DATABASE", dbacl, "", dbowner,
+ !buildACLCommands(fdbname, NULL, "DATABASE", dbacl, rdbacl, dbowner,
"", server_version, buf))
{
fprintf(stderr, _("%s: could not parse ACL list (%s) for database \"%s\"\n"),
dump_cmd => [
'pg_dumpall', '-f', "$tempdir/pg_dumpall_globals_clean.sql",
'-g', '-c', ], },
+ pg_dumpall_dbprivs => {
+ dump_cmd =>
+ [ 'pg_dumpall', '-f', "$tempdir/pg_dumpall_dbprivs.sql", ], },
no_privs => {
dump_cmd =>
[ 'pg_dump', '-f', "$tempdir/no_privs.sql", '-x', 'postgres', ], },
exclude_test_table => 1,
exclude_test_table_data => 1,
only_dump_test_schema => 1,
+ pg_dumpall_dbprivs => 1,
schema_only => 1,
section_post_data => 1,
test_schema_plus_blobs => 1, },
\QNOREPLICATION NOBYPASSRLS;\E
/xm,
like => {
+ pg_dumpall_dbprivs => 1,
pg_dumpall_globals => 1,
pg_dumpall_globals_clean => 1, },
unlike => {
exclude_test_table_data => 1,
no_privs => 1,
only_dump_test_schema => 1,
+ pg_dumpall_dbprivs => 1,
schema_only => 1,
section_pre_data => 1,
test_schema_plus_blobs => 1, },
exclude_test_table => 1,
exclude_test_table_data => 1,
no_privs => 1,
+ pg_dumpall_dbprivs => 1,
schema_only => 1,
section_pre_data => 1, },
unlike => {
exclude_test_table_data => 1,
no_privs => 1,
only_dump_test_schema => 1,
+ pg_dumpall_dbprivs => 1,
schema_only => 1,
section_pre_data => 1,
test_schema_plus_blobs => 1, },
exclude_test_table => 1,
exclude_test_table_data => 1,
no_privs => 1,
+ pg_dumpall_dbprivs => 1,
schema_only => 1,
section_pre_data => 1, },
unlike => {
no_privs => 1,
only_dump_test_schema => 1,
only_dump_test_table => 1,
+ pg_dumpall_dbprivs => 1,
schema_only => 1,
section_post_data => 1,
test_schema_plus_blobs => 1, },
no_privs => 1,
only_dump_test_schema => 1,
only_dump_test_table => 1,
+ pg_dumpall_dbprivs => 1,
schema_only => 1,
section_pre_data => 1,
test_schema_plus_blobs => 1, },
no_privs => 1,
only_dump_test_schema => 1,
only_dump_test_table => 1,
+ pg_dumpall_dbprivs => 1,
schema_only => 1,
section_post_data => 1,
test_schema_plus_blobs => 1, },
exclude_test_table_data => 1,
no_privs => 1,
only_dump_test_schema => 1,
+ pg_dumpall_dbprivs => 1,
schema_only => 1,
section_pre_data => 1,
test_schema_plus_blobs => 1, },
exclude_test_table => 1,
exclude_test_table_data => 1,
no_privs => 1,
+ pg_dumpall_dbprivs => 1,
schema_only => 1,
section_pre_data => 1, },
unlike => {
# exclude_test_table => 1,
# exclude_test_table_data => 1,
# no_privs => 1,
+ # pg_dumpall_dbprivs => 1,
# section_data => 1,
# test_schema_plus_blobs => 1,
# },
exclude_test_table_data => 1,
no_privs => 1,
no_owner => 1,
+ pg_dumpall_dbprivs => 1,
schema_only => 1,
section_pre_data => 1, },
unlike => {
exclude_test_table_data => 1,
no_privs => 1,
no_owner => 1,
+ pg_dumpall_dbprivs => 1,
schema_only => 1,
section_pre_data => 1, },
unlike => {
no_owner => 1,
only_dump_test_schema => 1,
only_dump_test_table => 1,
+ pg_dumpall_dbprivs => 1,
schema_only => 1,
section_pre_data => 1, },
unlike => {
no_owner => 1,
only_dump_test_schema => 1,
only_dump_test_table => 1,
+ pg_dumpall_dbprivs => 1,
schema_only => 1,
section_pre_data => 1, },
unlike => {
no_privs => 1,
no_owner => 1,
only_dump_test_schema => 1,
+ pg_dumpall_dbprivs => 1,
schema_only => 1,
section_pre_data => 1, },
unlike => {
no_owner => 1,
only_dump_test_schema => 1,
only_dump_test_table => 1,
+ pg_dumpall_dbprivs => 1,
section_data => 1,
test_schema_plus_blobs => 1, },
unlike => {
no_privs => 1,
no_owner => 1,
only_dump_test_schema => 1,
+ pg_dumpall_dbprivs => 1,
section_data => 1,
test_schema_plus_blobs => 1, },
unlike => {
no_privs => 1,
no_owner => 1,
only_dump_test_schema => 1,
+ pg_dumpall_dbprivs => 1,
section_data => 1,
test_schema_plus_blobs => 1, },
unlike => {
exclude_test_table_data => 1,
no_privs => 1,
no_owner => 1,
+ pg_dumpall_dbprivs => 1,
section_data => 1, },
unlike => {
only_dump_test_schema => 1,
exclude_test_table_data => 1,
no_privs => 1,
no_owner => 1,
+ pg_dumpall_dbprivs => 1,
section_data => 1,
only_dump_test_schema => 1,
only_dump_test_table => 1,
exclude_test_table_data => 1,
no_privs => 1,
no_owner => 1,
+ pg_dumpall_dbprivs => 1,
section_data => 1,
only_dump_test_schema => 1,
only_dump_test_table => 1,
exclude_test_table_data => 1,
no_privs => 1,
no_owner => 1,
+ pg_dumpall_dbprivs => 1,
section_data => 1,
only_dump_test_schema => 1,
only_dump_test_table => 1,
create_sql => 'CREATE ROLE dump_test;',
regexp => qr/^CREATE ROLE dump_test;/m,
like => {
+ pg_dumpall_dbprivs => 1,
pg_dumpall_globals => 1,
pg_dumpall_globals_clean => 1, },
unlike => {
no_owner => 1,
only_dump_test_schema => 1,
only_dump_test_table => 1,
+ pg_dumpall_dbprivs => 1,
+ pg_dumpall_globals => 1,
+ pg_dumpall_globals_clean => 1,
+ schema_only => 1,
+ section_pre_data => 1,
+ section_post_data => 1,
+ test_schema_plus_blobs => 1, }, },
+ 'CREATE DATABASE dump_test' => {
+ create_order => 47,
+ create_sql => 'CREATE DATABASE dump_test;',
+ regexp => qr/^
+ \QCREATE DATABASE dump_test WITH TEMPLATE = template0 \E
+ .*;/xm,
+ like => { pg_dumpall_dbprivs => 1, },
+ unlike => {
+ binary_upgrade => 1,
+ clean => 1,
+ clean_if_exists => 1,
+ createdb => 1,
+ defaults => 1,
+ exclude_dump_test_schema => 1,
+ exclude_test_table => 1,
+ exclude_test_table_data => 1,
+ no_privs => 1,
+ no_owner => 1,
+ only_dump_test_schema => 1,
+ only_dump_test_table => 1,
pg_dumpall_globals => 1,
pg_dumpall_globals_clean => 1,
schema_only => 1,
exclude_test_table_data => 1,
no_privs => 1,
no_owner => 1,
+ pg_dumpall_dbprivs => 1,
schema_only => 1,
section_pre_data => 1, },
unlike => {
no_privs => 1,
no_owner => 1,
only_dump_test_schema => 1,
+ pg_dumpall_dbprivs => 1,
schema_only => 1,
section_pre_data => 1,
test_schema_plus_blobs => 1, },
no_privs => 1,
no_owner => 1,
only_dump_test_schema => 1,
+ pg_dumpall_dbprivs => 1,
schema_only => 1,
section_pre_data => 1,
test_schema_plus_blobs => 1, },
no_privs => 1,
no_owner => 1,
only_dump_test_schema => 1,
+ pg_dumpall_dbprivs => 1,
schema_only => 1,
section_pre_data => 1,
test_schema_plus_blobs => 1, },
no_privs => 1,
no_owner => 1,
only_dump_test_schema => 1,
+ pg_dumpall_dbprivs => 1,
schema_only => 1,
section_pre_data => 1,
test_schema_plus_blobs => 1, },
no_privs => 1,
no_owner => 1,
only_dump_test_schema => 1,
+ pg_dumpall_dbprivs => 1,
schema_only => 1,
section_pre_data => 1,
test_schema_plus_blobs => 1, },
exclude_test_table_data => 1,
no_privs => 1,
no_owner => 1,
+ pg_dumpall_dbprivs => 1,
schema_only => 1,
section_post_data => 1, },
unlike => {
no_owner => 1,
only_dump_test_schema => 1,
only_dump_test_table => 1,
+ pg_dumpall_dbprivs => 1,
schema_only => 1,
section_post_data => 1,
test_schema_plus_blobs => 1, },
no_privs => 1,
no_owner => 1,
only_dump_test_schema => 1,
+ pg_dumpall_dbprivs => 1,
schema_only => 1,
section_pre_data => 1,
test_schema_plus_blobs => 1, },
no_privs => 1,
no_owner => 1,
only_dump_test_schema => 1,
+ pg_dumpall_dbprivs => 1,
schema_only => 1,
section_pre_data => 1,
test_schema_plus_blobs => 1,
no_privs => 1,
no_owner => 1,
only_dump_test_schema => 1,
+ pg_dumpall_dbprivs => 1,
schema_only => 1,
section_pre_data => 1,
test_schema_plus_blobs => 1, },
no_privs => 1,
no_owner => 1,
only_dump_test_schema => 1,
+ pg_dumpall_dbprivs => 1,
schema_only => 1,
section_pre_data => 1,
test_schema_plus_blobs => 1, },
no_privs => 1,
no_owner => 1,
only_dump_test_schema => 1,
+ pg_dumpall_dbprivs => 1,
schema_only => 1,
section_pre_data => 1,
test_schema_plus_blobs => 1, },
no_privs => 1,
no_owner => 1,
only_dump_test_schema => 1,
+ pg_dumpall_dbprivs => 1,
schema_only => 1,
section_pre_data => 1,
test_schema_plus_blobs => 1, },
no_privs => 1,
no_owner => 1,
only_dump_test_schema => 1,
+ pg_dumpall_dbprivs => 1,
schema_only => 1,
section_pre_data => 1,
test_schema_plus_blobs => 1, },
no_privs => 1,
no_owner => 1,
only_dump_test_schema => 1,
+ pg_dumpall_dbprivs => 1,
schema_only => 1,
section_pre_data => 1,
test_schema_plus_blobs => 1, },
exclude_test_table_data => 1,
no_privs => 1,
no_owner => 1,
+ pg_dumpall_dbprivs => 1,
schema_only => 1,
section_pre_data => 1, },
unlike => {
exclude_test_table_data => 1,
no_privs => 1,
no_owner => 1,
+ pg_dumpall_dbprivs => 1,
schema_only => 1,
section_pre_data => 1, },
unlike => {
# exclude_test_table_data => 1,
# no_privs => 1,
# no_owner => 1,
+# pg_dumpall_dbprivs => 1,
# schema_only => 1,
# section_post_data => 1,
# },
exclude_test_table_data => 1,
no_privs => 1,
no_owner => 1,
+ pg_dumpall_dbprivs => 1,
schema_only => 1,
section_pre_data => 1, },
unlike => {
no_privs => 1,
no_owner => 1,
only_dump_test_schema => 1,
+ pg_dumpall_dbprivs => 1,
schema_only => 1,
section_pre_data => 1,
test_schema_plus_blobs => 1, },
no_privs => 1,
no_owner => 1,
only_dump_test_schema => 1,
+ pg_dumpall_dbprivs => 1,
schema_only => 1,
section_pre_data => 1,
test_schema_plus_blobs => 1, },
no_owner => 1,
only_dump_test_schema => 1,
only_dump_test_table => 1,
+ pg_dumpall_dbprivs => 1,
schema_only => 1,
section_post_data => 1,
test_schema_plus_blobs => 1, },
no_owner => 1,
only_dump_test_schema => 1,
only_dump_test_table => 1,
+ pg_dumpall_dbprivs => 1,
schema_only => 1,
section_post_data => 1,
test_schema_plus_blobs => 1, },
no_owner => 1,
only_dump_test_schema => 1,
only_dump_test_table => 1,
+ pg_dumpall_dbprivs => 1,
schema_only => 1,
section_post_data => 1,
test_schema_plus_blobs => 1, },
no_owner => 1,
only_dump_test_schema => 1,
only_dump_test_table => 1,
+ pg_dumpall_dbprivs => 1,
schema_only => 1,
section_post_data => 1,
test_schema_plus_blobs => 1, },
no_owner => 1,
only_dump_test_schema => 1,
only_dump_test_table => 1,
+ pg_dumpall_dbprivs => 1,
schema_only => 1,
section_post_data => 1,
test_schema_plus_blobs => 1, },
no_privs => 1,
no_owner => 1,
only_dump_test_schema => 1,
+ pg_dumpall_dbprivs => 1,
schema_only => 1,
section_pre_data => 1,
test_schema_plus_blobs => 1, },
exclude_test_table_data => 1,
no_privs => 1,
no_owner => 1,
+ pg_dumpall_dbprivs => 1,
schema_only => 1,
section_pre_data => 1, },
unlike => {
no_owner => 1,
only_dump_test_schema => 1,
only_dump_test_table => 1,
+ pg_dumpall_dbprivs => 1,
schema_only => 1,
section_pre_data => 1,
test_schema_plus_blobs => 1, },
no_privs => 1,
no_owner => 1,
only_dump_test_schema => 1,
+ pg_dumpall_dbprivs => 1,
schema_only => 1,
section_pre_data => 1,
test_schema_plus_blobs => 1, },
no_privs => 1,
no_owner => 1,
only_dump_test_schema => 1,
+ pg_dumpall_dbprivs => 1,
schema_only => 1,
section_pre_data => 1,
test_schema_plus_blobs => 1, },
exclude_test_table_data => 1,
no_privs => 1,
no_owner => 1,
+ pg_dumpall_dbprivs => 1,
schema_only => 1,
section_pre_data => 1, },
unlike => {
no_owner => 1,
only_dump_test_schema => 1,
only_dump_test_table => 1,
+ pg_dumpall_dbprivs => 1,
schema_only => 1,
section_pre_data => 1,
test_schema_plus_blobs => 1, },
exclude_test_table_data => 1,
no_privs => 1,
no_owner => 1,
+ pg_dumpall_dbprivs => 1,
schema_only => 1,
section_pre_data => 1, },
unlike => {
exclude_test_table_data => 1,
no_privs => 1,
no_owner => 1,
+ pg_dumpall_dbprivs => 1,
schema_only => 1,
section_post_data => 1, },
unlike => {
no_owner => 1,
only_dump_test_schema => 1,
only_dump_test_table => 1,
+ pg_dumpall_dbprivs => 1,
pg_dumpall_globals => 1,
schema_only => 1, }, },
'GRANT USAGE ON SCHEMA dump_test_second_schema' => {
exclude_test_table => 1,
exclude_test_table_data => 1,
no_owner => 1,
+ pg_dumpall_dbprivs => 1,
schema_only => 1,
section_pre_data => 1, },
unlike => {
only_dump_test_table => 1,
pg_dumpall_globals => 1,
test_schema_plus_blobs => 1, }, },
+ 'GRANT CREATE ON DATABASE dump_test' => {
+ create_order => 48,
+ create_sql => 'GRANT CREATE ON DATABASE dump_test TO dump_test;',
+ regexp => qr/^
+ \QGRANT CREATE ON DATABASE dump_test TO dump_test;\E
+ /xm,
+ like => {
+ pg_dumpall_dbprivs => 1, },
+ unlike => {
+ binary_upgrade => 1,
+ clean => 1,
+ clean_if_exists => 1,
+ createdb => 1,
+ defaults => 1,
+ exclude_dump_test_schema => 1,
+ exclude_test_table => 1,
+ exclude_test_table_data => 1,
+ no_owner => 1,
+ only_dump_test_schema => 1,
+ only_dump_test_table => 1,
+ pg_dumpall_globals => 1,
+ schema_only => 1,
+ section_pre_data => 1, ,
+ test_schema_plus_blobs => 1, }, },
'GRANT SELECT ON TABLE test_table' => {
create_order => 5,
create_sql => 'GRANT SELECT ON TABLE dump_test.test_table
no_owner => 1,
only_dump_test_schema => 1,
only_dump_test_table => 1,
+ pg_dumpall_dbprivs => 1,
schema_only => 1,
section_pre_data => 1,
test_schema_plus_blobs => 1, },
exclude_test_table => 1,
exclude_test_table_data => 1,
no_owner => 1,
+ pg_dumpall_dbprivs => 1,
schema_only => 1,
section_pre_data => 1, },
unlike => {
exclude_test_table => 1,
exclude_test_table_data => 1,
no_owner => 1,
+ pg_dumpall_dbprivs => 1,
schema_only => 1,
section_pre_data => 1, },
unlike => {
exclude_test_table_data => 1,
no_owner => 1,
only_dump_test_schema => 1,
+ pg_dumpall_dbprivs => 1,
schema_only => 1,
section_pre_data => 1,
test_schema_plus_blobs => 1, },
exclude_test_table => 1,
exclude_test_table_data => 1,
no_owner => 1,
+ pg_dumpall_dbprivs => 1,
schema_only => 1,
section_pre_data => 1, },
unlike => {
exclude_test_table => 1,
exclude_test_table_data => 1,
no_owner => 1,
+ pg_dumpall_dbprivs => 1,
schema_only => 1,
section_pre_data => 1, },
unlike => {
no_privs => 1,
no_owner => 1,
only_dump_test_schema => 1,
+ pg_dumpall_dbprivs => 1,
test_schema_plus_blobs => 1,
section_post_data => 1, },
unlike => {
no_privs => 1,
no_owner => 1,
only_dump_test_schema => 1,
+ pg_dumpall_dbprivs => 1,
test_schema_plus_blobs => 1,
section_post_data => 1, },
unlike => {
pg_dumpall_globals => 1,
schema_only => 1,
section_pre_data => 1, }, },
+ 'REVOKE CONNECT ON DATABASE dump_test FROM public' => {
+ create_order => 49,
+ create_sql => 'REVOKE CONNECT ON DATABASE dump_test FROM public;',
+ regexp => qr/^
+ \QREVOKE CONNECT,TEMPORARY ON DATABASE dump_test FROM PUBLIC;\E\n
+ \QGRANT TEMPORARY ON DATABASE dump_test TO PUBLIC;\E
+ /xm,
+ like => {
+ pg_dumpall_dbprivs => 1, },
+ unlike => {
+ binary_upgrade => 1,
+ clean => 1,
+ clean_if_exists => 1,
+ createdb => 1,
+ defaults => 1,
+ exclude_dump_test_schema => 1,
+ exclude_test_table => 1,
+ exclude_test_table_data => 1,
+ no_owner => 1,
+ only_dump_test_schema => 1,
+ only_dump_test_table => 1,
+ schema_only => 1,
+ section_pre_data => 1,
+ test_schema_plus_blobs => 1, }, },
'REVOKE EXECUTE ON FUNCTION pg_sleep() FROM public' => {
create_order => 15,
create_sql => 'REVOKE EXECUTE ON FUNCTION pg_sleep(float8)
exclude_test_table => 1,
exclude_test_table_data => 1,
no_owner => 1,
+ pg_dumpall_dbprivs => 1,
schema_only => 1,
section_pre_data => 1, },
unlike => {
exclude_test_table => 1,
exclude_test_table_data => 1,
no_owner => 1,
+ pg_dumpall_dbprivs => 1,
schema_only => 1,
section_pre_data => 1, },
unlike => {
exclude_test_table => 1,
exclude_test_table_data => 1,
no_owner => 1,
+ pg_dumpall_dbprivs => 1,
schema_only => 1,
section_pre_data => 1, },
unlike => {
exclude_test_table => 1,
exclude_test_table_data => 1,
no_owner => 1,
+ pg_dumpall_dbprivs => 1,
schema_only => 1,
section_pre_data => 1, },
unlike => {