Commit 58da8334 authored by Stephen Frost's avatar Stephen Frost

test_pg_dump: perltidy cleanup

As pointed out by Alvaro, we actually use perltidy on the perl scripts
in the source tree, so go back to the results of a perltidy run for the
test_pg_dump TAP script.

To make it look slightly less tragic, I changed most of the independent
arguments into long-form single arguments (eg: -f file.sql changed to be
--file=file.sql) to avoid having them confusingly split across lines due
to perltidy.

Back-patch to 9.6, as the last patch was.
parent 1e5a5d03
...@@ -41,162 +41,105 @@ my $tempdir_short = TestLib::tempdir_short; ...@@ -41,162 +41,105 @@ my $tempdir_short = TestLib::tempdir_short;
my %pgdump_runs = ( my %pgdump_runs = (
binary_upgrade => { binary_upgrade => {
dump_cmd => [ dump_cmd => [
'pg_dump', 'pg_dump', "--file=$tempdir/binary_upgrade.sql",
'-f', "$tempdir/binary_upgrade.sql", '--schema-only', '--binary-upgrade',
'--schema-only', '--dbname=postgres', ], },
'--binary-upgrade',
'-d', 'postgres', # alternative way to specify database
], },
clean => { clean => {
dump_cmd => [ dump_cmd => [
'pg_dump', 'pg_dump', "--file=$tempdir/clean.sql",
'-f', "$tempdir/clean.sql", '-c', '--dbname=postgres', ], },
'-c',
'-d', 'postgres', # alternative way to specify database
], },
clean_if_exists => { clean_if_exists => {
dump_cmd => [ dump_cmd => [
'pg_dump', 'pg_dump',
'-f', "$tempdir/clean_if_exists.sql", "--file=$tempdir/clean_if_exists.sql",
'-c', '-c',
'--if-exists', '--if-exists',
'-E', 'UTF8', # no-op, just tests that option is accepted '--encoding=UTF8', # no-op, just tests that option is accepted
'postgres', 'postgres', ], },
], },
column_inserts => { column_inserts => {
dump_cmd => [ dump_cmd => [
'pg_dump', 'pg_dump', "--file=$tempdir/column_inserts.sql",
'-f', "$tempdir/column_inserts.sql", '-a', '--column-inserts',
'-a', 'postgres', ], },
'--column-inserts',
'postgres',
], },
createdb => { createdb => {
dump_cmd => [ dump_cmd => [
'pg_dump', 'pg_dump',
'-f', "$tempdir/createdb.sql", "--file=$tempdir/createdb.sql",
'-C', '-C',
'-R', # no-op, just for testing '-R', # no-op, just for testing
'postgres', 'postgres', ], },
], },
data_only => { data_only => {
dump_cmd => [ dump_cmd => [
'pg_dump', 'pg_dump',
'-f', "$tempdir/data_only.sql", "--file=$tempdir/data_only.sql",
'-a', '-a',
'-v', # no-op, just make sure it works '-v', # no-op, just make sure it works
'postgres', 'postgres', ], },
], },
defaults => { defaults => {
dump_cmd => [ dump_cmd => [ 'pg_dump', '-f', "$tempdir/defaults.sql", 'postgres', ],
'pg_dump', },
'-f', "$tempdir/defaults.sql",
'postgres',
], },
defaults_custom_format => { defaults_custom_format => {
test_key => 'defaults', test_key => 'defaults',
dump_cmd => [ dump_cmd => [
'pg_dump', 'pg_dump', '-Fc', '-Z6',
'-Fc', "--file=$tempdir/defaults_custom_format.dump", 'postgres', ],
'-Z6',
'-f', "$tempdir/defaults_custom_format.dump",
'postgres',
],
restore_cmd => [ restore_cmd => [
'pg_restore', 'pg_restore',
'-f', "$tempdir/defaults_custom_format.sql", "--file=$tempdir/defaults_custom_format.sql",
"$tempdir/defaults_custom_format.dump", "$tempdir/defaults_custom_format.dump", ], },
], },
defaults_dir_format => { defaults_dir_format => {
test_key => 'defaults', test_key => 'defaults',
dump_cmd => [ dump_cmd => [
'pg_dump', 'pg_dump', '-Fd',
'-Fd', "--file=$tempdir/defaults_dir_format", 'postgres', ],
'-f', "$tempdir/defaults_dir_format",
'postgres',
],
restore_cmd => [ restore_cmd => [
'pg_restore', 'pg_restore',
'-f', "$tempdir/defaults_dir_format.sql", "--file=$tempdir/defaults_dir_format.sql",
"$tempdir/defaults_dir_format", "$tempdir/defaults_dir_format", ], },
], },
defaults_parallel => { defaults_parallel => {
test_key => 'defaults', test_key => 'defaults',
dump_cmd => [ dump_cmd => [
'pg_dump', 'pg_dump', '-Fd', '-j2', "--file=$tempdir/defaults_parallel",
'-Fd', 'postgres', ],
'-j2',
'-f', "$tempdir/defaults_parallel",
'postgres',
],
restore_cmd => [ restore_cmd => [
'pg_restore', 'pg_restore',
'-f', "$tempdir/defaults_parallel.sql", "--file=$tempdir/defaults_parallel.sql",
"$tempdir/defaults_parallel", "$tempdir/defaults_parallel", ], },
],
},
defaults_tar_format => { defaults_tar_format => {
test_key => 'defaults', test_key => 'defaults',
dump_cmd => [ dump_cmd => [
'pg_dump', 'pg_dump', '-Ft',
'-Ft', "--file=$tempdir/defaults_tar_format.tar", 'postgres', ],
'-f', "$tempdir/defaults_tar_format.tar",
'postgres',
],
restore_cmd => [ restore_cmd => [
'pg_restore', 'pg_restore',
'-f', "$tempdir/defaults_tar_format.sql", "--file=$tempdir/defaults_tar_format.sql",
"$tempdir/defaults_tar_format.tar", "$tempdir/defaults_tar_format.tar", ], },
], },
pg_dumpall_globals => { pg_dumpall_globals => {
dump_cmd => [ dump_cmd =>
'pg_dumpall', [ 'pg_dumpall', "--file=$tempdir/pg_dumpall_globals.sql", '-g', ],
'-f', "$tempdir/pg_dumpall_globals.sql", },
'-g',
], },
no_privs => { no_privs => {
dump_cmd => [ dump_cmd =>
'pg_dump', [ 'pg_dump', "--file=$tempdir/no_privs.sql", '-x', 'postgres', ], },
'-f', "$tempdir/no_privs.sql",
'-x',
'postgres',
], },
no_owner => { no_owner => {
dump_cmd => [ dump_cmd =>
'pg_dump', [ 'pg_dump', "--file=$tempdir/no_owner.sql", '-O', 'postgres', ], },
'-f', "$tempdir/no_owner.sql",
'-O',
'postgres',
], },
schema_only => { schema_only => {
dump_cmd => [ dump_cmd =>
'pg_dump', [ 'pg_dump', "--file=$tempdir/schema_only.sql", '-s', 'postgres', ],
'-f', "$tempdir/schema_only.sql", },
'-s',
'postgres',
], },
section_pre_data => { section_pre_data => {
dump_cmd => [ dump_cmd => [
'pg_dump', 'pg_dump', "--file=$tempdir/section_pre_data.sql",
'-f', "$tempdir/section_pre_data.sql", '--section=pre-data', 'postgres', ], },
'--section=pre-data',
'postgres',
], },
section_data => { section_data => {
dump_cmd => [ dump_cmd => [
'pg_dump', 'pg_dump', "--file=$tempdir/section_data.sql",
'-f', "$tempdir/section_data.sql", '--section=data', 'postgres', ], },
'--section=data',
'postgres',
], },
section_post_data => { section_post_data => {
dump_cmd => [ dump_cmd => [
'pg_dump', 'pg_dump', "--file=$tempdir/section_post_data.sql",
'-f', "$tempdir/section_post_data.sql", '--section=post-data', 'postgres', ], },);
'--section=post-data',
'postgres',
], },
);
############################################################### ###############################################################
# Definition of the tests to run. # Definition of the tests to run.
...@@ -238,15 +181,14 @@ my %pgdump_runs = ( ...@@ -238,15 +181,14 @@ my %pgdump_runs = (
my %tests = ( my %tests = (
'ALTER EXTENSION test_pg_dump' => { 'ALTER EXTENSION test_pg_dump' => {
create_order => 9, create_order => 9,
create_sql => 'ALTER EXTENSION test_pg_dump ADD TABLE regress_pg_dump_table_added;', create_sql =>
'ALTER EXTENSION test_pg_dump ADD TABLE regress_pg_dump_table_added;',
regexp => qr/^ regexp => qr/^
\QCREATE TABLE regress_pg_dump_table_added (\E \QCREATE TABLE regress_pg_dump_table_added (\E
\n\s+\Qcol1 integer NOT NULL,\E \n\s+\Qcol1 integer NOT NULL,\E
\n\s+\Qcol2 integer\E \n\s+\Qcol2 integer\E
\n\);\n/xm, \n\);\n/xm,
like => { like => { binary_upgrade => 1, },
binary_upgrade => 1,
},
unlike => { unlike => {
clean => 1, clean => 1,
clean_if_exists => 1, clean_if_exists => 1,
...@@ -257,8 +199,7 @@ my %tests = ( ...@@ -257,8 +199,7 @@ my %tests = (
pg_dumpall_globals => 1, pg_dumpall_globals => 1,
schema_only => 1, schema_only => 1,
section_pre_data => 1, section_pre_data => 1,
section_post_data => 1, section_post_data => 1, }, },
}, },
'CREATE EXTENSION test_pg_dump' => { 'CREATE EXTENSION test_pg_dump' => {
create_order => 2, create_order => 2,
...@@ -274,21 +215,17 @@ my %tests = ( ...@@ -274,21 +215,17 @@ my %tests = (
no_privs => 1, no_privs => 1,
no_owner => 1, no_owner => 1,
schema_only => 1, schema_only => 1,
section_pre_data => 1, section_pre_data => 1, },
},
unlike => { unlike => {
binary_upgrade => 1, binary_upgrade => 1,
pg_dumpall_globals => 1, pg_dumpall_globals => 1,
section_post_data => 1, section_post_data => 1, }, },
}, },
'CREATE ROLE regress_dump_test_role' => { 'CREATE ROLE regress_dump_test_role' => {
create_order => 1, create_order => 1,
create_sql => 'CREATE ROLE regress_dump_test_role;', create_sql => 'CREATE ROLE regress_dump_test_role;',
regexp => qr/^CREATE ROLE regress_dump_test_role;\n/m, regexp => qr/^CREATE ROLE regress_dump_test_role;\n/m,
like => { like => { pg_dumpall_globals => 1, },
pg_dumpall_globals => 1,
},
unlike => { unlike => {
binary_upgrade => 1, binary_upgrade => 1,
clean => 1, clean => 1,
...@@ -299,8 +236,7 @@ my %tests = ( ...@@ -299,8 +236,7 @@ my %tests = (
no_owner => 1, no_owner => 1,
schema_only => 1, schema_only => 1,
section_pre_data => 1, section_pre_data => 1,
section_post_data => 1, section_post_data => 1, }, },
}, },
'CREATE SEQUENCE regress_pg_dump_table_col1_seq' => { 'CREATE SEQUENCE regress_pg_dump_table_col1_seq' => {
regexp => qr/^ regexp => qr/^
...@@ -311,9 +247,7 @@ my %tests = ( ...@@ -311,9 +247,7 @@ my %tests = (
\n\s+\QNO MAXVALUE\E \n\s+\QNO MAXVALUE\E
\n\s+\QCACHE 1;\E \n\s+\QCACHE 1;\E
\n/xm, \n/xm,
like => { like => { binary_upgrade => 1, },
binary_upgrade => 1,
},
unlike => { unlike => {
clean => 1, clean => 1,
clean_if_exists => 1, clean_if_exists => 1,
...@@ -324,20 +258,18 @@ my %tests = ( ...@@ -324,20 +258,18 @@ my %tests = (
pg_dumpall_globals => 1, pg_dumpall_globals => 1,
schema_only => 1, schema_only => 1,
section_pre_data => 1, section_pre_data => 1,
section_post_data => 1, section_post_data => 1, }, },
}, },
'CREATE TABLE regress_pg_dump_table_added' => { 'CREATE TABLE regress_pg_dump_table_added' => {
create_order => 7, create_order => 7,
create_sql => 'CREATE TABLE regress_pg_dump_table_added (col1 int not null, col2 int);', create_sql =>
'CREATE TABLE regress_pg_dump_table_added (col1 int not null, col2 int);',
regexp => qr/^ regexp => qr/^
\QCREATE TABLE regress_pg_dump_table_added (\E \QCREATE TABLE regress_pg_dump_table_added (\E
\n\s+\Qcol1 integer NOT NULL,\E \n\s+\Qcol1 integer NOT NULL,\E
\n\s+\Qcol2 integer\E \n\s+\Qcol2 integer\E
\n\);\n/xm, \n\);\n/xm,
like => { like => { binary_upgrade => 1, },
binary_upgrade => 1,
},
unlike => { unlike => {
clean => 1, clean => 1,
clean_if_exists => 1, clean_if_exists => 1,
...@@ -348,8 +280,7 @@ my %tests = ( ...@@ -348,8 +280,7 @@ my %tests = (
pg_dumpall_globals => 1, pg_dumpall_globals => 1,
schema_only => 1, schema_only => 1,
section_pre_data => 1, section_pre_data => 1,
section_post_data => 1, section_post_data => 1, }, },
}, },
'CREATE SEQUENCE regress_pg_dump_seq' => { 'CREATE SEQUENCE regress_pg_dump_seq' => {
regexp => qr/^ regexp => qr/^
...@@ -360,9 +291,7 @@ my %tests = ( ...@@ -360,9 +291,7 @@ my %tests = (
\n\s+\QNO MAXVALUE\E \n\s+\QNO MAXVALUE\E
\n\s+\QCACHE 1;\E \n\s+\QCACHE 1;\E
\n/xm, \n/xm,
like => { like => { binary_upgrade => 1, },
binary_upgrade => 1,
},
unlike => { unlike => {
clean => 1, clean => 1,
clean_if_exists => 1, clean_if_exists => 1,
...@@ -373,8 +302,7 @@ my %tests = ( ...@@ -373,8 +302,7 @@ my %tests = (
pg_dumpall_globals => 1, pg_dumpall_globals => 1,
schema_only => 1, schema_only => 1,
section_pre_data => 1, section_pre_data => 1,
section_post_data => 1, section_post_data => 1, }, },
}, },
'SETVAL SEQUENCE regress_seq_dumpable' => { 'SETVAL SEQUENCE regress_seq_dumpable' => {
create_order => 6, create_order => 6,
...@@ -389,14 +317,12 @@ my %tests = ( ...@@ -389,14 +317,12 @@ my %tests = (
data_only => 1, data_only => 1,
defaults => 1, defaults => 1,
no_owner => 1, no_owner => 1,
no_privs => 1, no_privs => 1, },
},
unlike => { unlike => {
pg_dumpall_globals => 1, pg_dumpall_globals => 1,
schema_only => 1, schema_only => 1,
section_pre_data => 1, section_pre_data => 1,
section_post_data => 1, section_post_data => 1, }, },
}, },
'CREATE TABLE regress_pg_dump_table' => { 'CREATE TABLE regress_pg_dump_table' => {
regexp => qr/^ regexp => qr/^
...@@ -404,9 +330,7 @@ my %tests = ( ...@@ -404,9 +330,7 @@ my %tests = (
\n\s+\Qcol1 integer NOT NULL,\E \n\s+\Qcol1 integer NOT NULL,\E
\n\s+\Qcol2 integer\E \n\s+\Qcol2 integer\E
\n\);\n/xm, \n\);\n/xm,
like => { like => { binary_upgrade => 1, },
binary_upgrade => 1,
},
unlike => { unlike => {
clean => 1, clean => 1,
clean_if_exists => 1, clean_if_exists => 1,
...@@ -417,16 +341,13 @@ my %tests = ( ...@@ -417,16 +341,13 @@ my %tests = (
pg_dumpall_globals => 1, pg_dumpall_globals => 1,
schema_only => 1, schema_only => 1,
section_pre_data => 1, section_pre_data => 1,
section_post_data => 1, section_post_data => 1, }, },
}, },
'CREATE ACCESS METHOD regress_test_am' => { 'CREATE ACCESS METHOD regress_test_am' => {
regexp => qr/^ regexp => qr/^
\QCREATE ACCESS METHOD regress_test_am TYPE INDEX HANDLER bthandler;\E \QCREATE ACCESS METHOD regress_test_am TYPE INDEX HANDLER bthandler;\E
\n/xm, \n/xm,
like => { like => { binary_upgrade => 1, },
binary_upgrade => 1,
},
unlike => { unlike => {
clean => 1, clean => 1,
clean_if_exists => 1, clean_if_exists => 1,
...@@ -437,8 +358,7 @@ my %tests = ( ...@@ -437,8 +358,7 @@ my %tests = (
pg_dumpall_globals => 1, pg_dumpall_globals => 1,
schema_only => 1, schema_only => 1,
section_pre_data => 1, section_pre_data => 1,
section_post_data => 1, section_post_data => 1, }, },
}, },
'COMMENT ON EXTENSION test_pg_dump' => { 'COMMENT ON EXTENSION test_pg_dump' => {
regexp => qr/^ regexp => qr/^
...@@ -454,22 +374,19 @@ my %tests = ( ...@@ -454,22 +374,19 @@ my %tests = (
no_privs => 1, no_privs => 1,
no_owner => 1, no_owner => 1,
schema_only => 1, schema_only => 1,
section_pre_data => 1, section_pre_data => 1, },
},
unlike => { unlike => {
pg_dumpall_globals => 1, pg_dumpall_globals => 1,
section_post_data => 1, section_post_data => 1, }, },
}, },
'GRANT SELECT regress_pg_dump_table_added pre-ALTER EXTENSION' => { 'GRANT SELECT regress_pg_dump_table_added pre-ALTER EXTENSION' => {
create_order => 8, create_order => 8,
create_sql => 'GRANT SELECT ON regress_pg_dump_table_added TO regress_dump_test_role;', create_sql =>
'GRANT SELECT ON regress_pg_dump_table_added TO regress_dump_test_role;',
regexp => qr/^ regexp => qr/^
\QGRANT SELECT ON TABLE regress_pg_dump_table_added TO regress_dump_test_role;\E \QGRANT SELECT ON TABLE regress_pg_dump_table_added TO regress_dump_test_role;\E
\n/xm, \n/xm,
like => { like => { binary_upgrade => 1, },
binary_upgrade => 1,
},
unlike => { unlike => {
clean => 1, clean => 1,
clean_if_exists => 1, clean_if_exists => 1,
...@@ -480,12 +397,12 @@ my %tests = ( ...@@ -480,12 +397,12 @@ my %tests = (
pg_dumpall_globals => 1, pg_dumpall_globals => 1,
schema_only => 1, schema_only => 1,
section_pre_data => 1, section_pre_data => 1,
section_post_data => 1, section_post_data => 1, }, },
}, },
'REVOKE SELECT regress_pg_dump_table_added post-ALTER EXTENSION' => { 'REVOKE SELECT regress_pg_dump_table_added post-ALTER EXTENSION' => {
create_order => 10, create_order => 10,
create_sql => 'REVOKE SELECT ON regress_pg_dump_table_added FROM regress_dump_test_role;', create_sql =>
'REVOKE SELECT ON regress_pg_dump_table_added FROM regress_dump_test_role;',
regexp => qr/^ regexp => qr/^
\QREVOKE SELECT ON TABLE regress_pg_dump_table_added FROM regress_dump_test_role;\E \QREVOKE SELECT ON TABLE regress_pg_dump_table_added FROM regress_dump_test_role;\E
\n/xm, \n/xm,
...@@ -497,13 +414,11 @@ my %tests = ( ...@@ -497,13 +414,11 @@ my %tests = (
defaults => 1, defaults => 1,
no_owner => 1, no_owner => 1,
schema_only => 1, schema_only => 1,
section_pre_data => 1, section_pre_data => 1, },
},
unlike => { unlike => {
no_privs => 1, no_privs => 1,
pg_dumpall_globals => 1, pg_dumpall_globals => 1,
section_post_data => 1, section_post_data => 1, }, },
}, },
'GRANT SELECT ON TABLE regress_pg_dump_table' => { 'GRANT SELECT ON TABLE regress_pg_dump_table' => {
regexp => qr/^ regexp => qr/^
...@@ -511,9 +426,7 @@ my %tests = ( ...@@ -511,9 +426,7 @@ my %tests = (
\QGRANT SELECT ON TABLE regress_pg_dump_table TO regress_dump_test_role;\E\n \QGRANT SELECT ON TABLE regress_pg_dump_table TO regress_dump_test_role;\E\n
\QSELECT pg_catalog.binary_upgrade_set_record_init_privs(false);\E \QSELECT pg_catalog.binary_upgrade_set_record_init_privs(false);\E
\n/xms, \n/xms,
like => { like => { binary_upgrade => 1, },
binary_upgrade => 1,
},
unlike => { unlike => {
clean => 1, clean => 1,
clean_if_exists => 1, clean_if_exists => 1,
...@@ -524,8 +437,7 @@ my %tests = ( ...@@ -524,8 +437,7 @@ my %tests = (
section_pre_data => 1, section_pre_data => 1,
no_privs => 1, no_privs => 1,
pg_dumpall_globals => 1, pg_dumpall_globals => 1,
section_post_data => 1, section_post_data => 1, }, },
}, },
'GRANT SELECT(col1) ON regress_pg_dump_table' => { 'GRANT SELECT(col1) ON regress_pg_dump_table' => {
regexp => qr/^ regexp => qr/^
...@@ -533,9 +445,7 @@ my %tests = ( ...@@ -533,9 +445,7 @@ my %tests = (
\QGRANT SELECT(col1) ON TABLE regress_pg_dump_table TO PUBLIC;\E\n \QGRANT SELECT(col1) ON TABLE regress_pg_dump_table TO PUBLIC;\E\n
\QSELECT pg_catalog.binary_upgrade_set_record_init_privs(false);\E \QSELECT pg_catalog.binary_upgrade_set_record_init_privs(false);\E
\n/xms, \n/xms,
like => { like => { binary_upgrade => 1, },
binary_upgrade => 1,
},
unlike => { unlike => {
clean => 1, clean => 1,
clean_if_exists => 1, clean_if_exists => 1,
...@@ -546,10 +456,10 @@ my %tests = ( ...@@ -546,10 +456,10 @@ my %tests = (
section_pre_data => 1, section_pre_data => 1,
no_privs => 1, no_privs => 1,
pg_dumpall_globals => 1, pg_dumpall_globals => 1,
section_post_data => 1, section_post_data => 1, }, },
}, },
'GRANT SELECT(col2) ON regress_pg_dump_table TO regress_dump_test_role' => { 'GRANT SELECT(col2) ON regress_pg_dump_table TO regress_dump_test_role'
=> {
create_order => 4, create_order => 4,
create_sql => 'GRANT SELECT(col2) ON regress_pg_dump_table create_sql => 'GRANT SELECT(col2) ON regress_pg_dump_table
TO regress_dump_test_role;', TO regress_dump_test_role;',
...@@ -564,15 +474,14 @@ my %tests = ( ...@@ -564,15 +474,14 @@ my %tests = (
defaults => 1, defaults => 1,
no_owner => 1, no_owner => 1,
schema_only => 1, schema_only => 1,
section_pre_data => 1, section_pre_data => 1, },
},
unlike => { unlike => {
no_privs => 1, no_privs => 1,
pg_dumpall_globals => 1, pg_dumpall_globals => 1,
section_post_data => 1, section_post_data => 1, }, },
}, },
'GRANT USAGE ON regress_pg_dump_table_col1_seq TO regress_dump_test_role' => { 'GRANT USAGE ON regress_pg_dump_table_col1_seq TO regress_dump_test_role'
=> {
create_order => 5, create_order => 5,
create_sql => 'GRANT USAGE ON SEQUENCE regress_pg_dump_table_col1_seq create_sql => 'GRANT USAGE ON SEQUENCE regress_pg_dump_table_col1_seq
TO regress_dump_test_role;', TO regress_dump_test_role;',
...@@ -587,21 +496,17 @@ my %tests = ( ...@@ -587,21 +496,17 @@ my %tests = (
defaults => 1, defaults => 1,
no_owner => 1, no_owner => 1,
schema_only => 1, schema_only => 1,
section_pre_data => 1, section_pre_data => 1, },
},
unlike => { unlike => {
no_privs => 1, no_privs => 1,
pg_dumpall_globals => 1, pg_dumpall_globals => 1,
section_post_data => 1, section_post_data => 1, }, },
}, },
'GRANT USAGE ON regress_pg_dump_seq TO regress_dump_test_role' => { 'GRANT USAGE ON regress_pg_dump_seq TO regress_dump_test_role' => {
regexp => qr/^ regexp => qr/^
\QGRANT USAGE ON SEQUENCE regress_pg_dump_seq TO regress_dump_test_role;\E \QGRANT USAGE ON SEQUENCE regress_pg_dump_seq TO regress_dump_test_role;\E
\n/xm, \n/xm,
like => { like => { binary_upgrade => 1, },
binary_upgrade => 1,
},
unlike => { unlike => {
clean => 1, clean => 1,
clean_if_exists => 1, clean_if_exists => 1,
...@@ -612,8 +517,7 @@ my %tests = ( ...@@ -612,8 +517,7 @@ my %tests = (
pg_dumpall_globals => 1, pg_dumpall_globals => 1,
schema_only => 1, schema_only => 1,
section_pre_data => 1, section_pre_data => 1,
section_post_data => 1, section_post_data => 1, }, },
}, },
'REVOKE SELECT(col1) ON regress_pg_dump_table' => { 'REVOKE SELECT(col1) ON regress_pg_dump_table' => {
create_order => 3, create_order => 3,
...@@ -630,13 +534,11 @@ my %tests = ( ...@@ -630,13 +534,11 @@ my %tests = (
defaults => 1, defaults => 1,
no_owner => 1, no_owner => 1,
schema_only => 1, schema_only => 1,
section_pre_data => 1, section_pre_data => 1, },
},
unlike => { unlike => {
no_privs => 1, no_privs => 1,
pg_dumpall_globals => 1, pg_dumpall_globals => 1,
section_post_data => 1, section_post_data => 1, }, },
}, },
# Objects included in extension part of a schema created by this extension */ # Objects included in extension part of a schema created by this extension */
'CREATE TABLE regress_pg_dump_schema.test_table' => { 'CREATE TABLE regress_pg_dump_schema.test_table' => {
...@@ -645,9 +547,7 @@ my %tests = ( ...@@ -645,9 +547,7 @@ my %tests = (
\n\s+\Qcol1 integer,\E \n\s+\Qcol1 integer,\E
\n\s+\Qcol2 integer\E \n\s+\Qcol2 integer\E
\n\);\n/xm, \n\);\n/xm,
like => { like => { binary_upgrade => 1, },
binary_upgrade => 1,
},
unlike => { unlike => {
clean => 1, clean => 1,
clean_if_exists => 1, clean_if_exists => 1,
...@@ -658,8 +558,7 @@ my %tests = ( ...@@ -658,8 +558,7 @@ my %tests = (
pg_dumpall_globals => 1, pg_dumpall_globals => 1,
schema_only => 1, schema_only => 1,
section_pre_data => 1, section_pre_data => 1,
section_post_data => 1, section_post_data => 1, }, },
}, },
'GRANT SELECT ON regress_pg_dump_schema.test_table' => { 'GRANT SELECT ON regress_pg_dump_schema.test_table' => {
regexp => qr/^ regexp => qr/^
...@@ -667,9 +566,7 @@ my %tests = ( ...@@ -667,9 +566,7 @@ my %tests = (
\QGRANT SELECT ON TABLE test_table TO regress_dump_test_role;\E\n \QGRANT SELECT ON TABLE test_table TO regress_dump_test_role;\E\n
\QSELECT pg_catalog.binary_upgrade_set_record_init_privs(false);\E \QSELECT pg_catalog.binary_upgrade_set_record_init_privs(false);\E
\n/xms, \n/xms,
like => { like => { binary_upgrade => 1, },
binary_upgrade => 1,
},
unlike => { unlike => {
clean => 1, clean => 1,
clean_if_exists => 1, clean_if_exists => 1,
...@@ -680,8 +577,7 @@ my %tests = ( ...@@ -680,8 +577,7 @@ my %tests = (
pg_dumpall_globals => 1, pg_dumpall_globals => 1,
schema_only => 1, schema_only => 1,
section_pre_data => 1, section_pre_data => 1,
section_post_data => 1, section_post_data => 1, }, },
}, },
'CREATE SEQUENCE regress_pg_dump_schema.test_seq' => { 'CREATE SEQUENCE regress_pg_dump_schema.test_seq' => {
regexp => qr/^ regexp => qr/^
...@@ -692,9 +588,7 @@ my %tests = ( ...@@ -692,9 +588,7 @@ my %tests = (
\n\s+\QNO MAXVALUE\E \n\s+\QNO MAXVALUE\E
\n\s+\QCACHE 1;\E \n\s+\QCACHE 1;\E
\n/xm, \n/xm,
like => { like => { binary_upgrade => 1, },
binary_upgrade => 1,
},
unlike => { unlike => {
clean => 1, clean => 1,
clean_if_exists => 1, clean_if_exists => 1,
...@@ -705,8 +599,7 @@ my %tests = ( ...@@ -705,8 +599,7 @@ my %tests = (
pg_dumpall_globals => 1, pg_dumpall_globals => 1,
schema_only => 1, schema_only => 1,
section_pre_data => 1, section_pre_data => 1,
section_post_data => 1, section_post_data => 1, }, },
}, },
'GRANT USAGE ON regress_pg_dump_schema.test_seq' => { 'GRANT USAGE ON regress_pg_dump_schema.test_seq' => {
regexp => qr/^ regexp => qr/^
...@@ -714,9 +607,7 @@ my %tests = ( ...@@ -714,9 +607,7 @@ my %tests = (
\QGRANT USAGE ON SEQUENCE test_seq TO regress_dump_test_role;\E\n \QGRANT USAGE ON SEQUENCE test_seq TO regress_dump_test_role;\E\n
\QSELECT pg_catalog.binary_upgrade_set_record_init_privs(false);\E \QSELECT pg_catalog.binary_upgrade_set_record_init_privs(false);\E
\n/xms, \n/xms,
like => { like => { binary_upgrade => 1, },
binary_upgrade => 1,
},
unlike => { unlike => {
clean => 1, clean => 1,
clean_if_exists => 1, clean_if_exists => 1,
...@@ -727,17 +618,14 @@ my %tests = ( ...@@ -727,17 +618,14 @@ my %tests = (
pg_dumpall_globals => 1, pg_dumpall_globals => 1,
schema_only => 1, schema_only => 1,
section_pre_data => 1, section_pre_data => 1,
section_post_data => 1, section_post_data => 1, }, },
}, },
'CREATE TYPE regress_pg_dump_schema.test_type' => { 'CREATE TYPE regress_pg_dump_schema.test_type' => {
regexp => qr/^ regexp => qr/^
\QCREATE TYPE test_type AS (\E \QCREATE TYPE test_type AS (\E
\n\s+\Qcol1 integer\E \n\s+\Qcol1 integer\E
\n\);\n/xm, \n\);\n/xm,
like => { like => { binary_upgrade => 1, },
binary_upgrade => 1,
},
unlike => { unlike => {
clean => 1, clean => 1,
clean_if_exists => 1, clean_if_exists => 1,
...@@ -748,8 +636,7 @@ my %tests = ( ...@@ -748,8 +636,7 @@ my %tests = (
pg_dumpall_globals => 1, pg_dumpall_globals => 1,
schema_only => 1, schema_only => 1,
section_pre_data => 1, section_pre_data => 1,
section_post_data => 1, section_post_data => 1, }, },
}, },
'GRANT USAGE ON regress_pg_dump_schema.test_type' => { 'GRANT USAGE ON regress_pg_dump_schema.test_type' => {
regexp => qr/^ regexp => qr/^
...@@ -757,9 +644,7 @@ my %tests = ( ...@@ -757,9 +644,7 @@ my %tests = (
\QGRANT ALL ON TYPE test_type TO regress_dump_test_role;\E\n \QGRANT ALL ON TYPE test_type TO regress_dump_test_role;\E\n
\QSELECT pg_catalog.binary_upgrade_set_record_init_privs(false);\E \QSELECT pg_catalog.binary_upgrade_set_record_init_privs(false);\E
\n/xms, \n/xms,
like => { like => { binary_upgrade => 1, },
binary_upgrade => 1,
},
unlike => { unlike => {
clean => 1, clean => 1,
clean_if_exists => 1, clean_if_exists => 1,
...@@ -770,17 +655,14 @@ my %tests = ( ...@@ -770,17 +655,14 @@ my %tests = (
pg_dumpall_globals => 1, pg_dumpall_globals => 1,
schema_only => 1, schema_only => 1,
section_pre_data => 1, section_pre_data => 1,
section_post_data => 1, section_post_data => 1, }, },
}, },
'CREATE FUNCTION regress_pg_dump_schema.test_func' => { 'CREATE FUNCTION regress_pg_dump_schema.test_func' => {
regexp => qr/^ regexp => qr/^
\QCREATE FUNCTION test_func() RETURNS integer\E \QCREATE FUNCTION test_func() RETURNS integer\E
\n\s+\QLANGUAGE sql\E \n\s+\QLANGUAGE sql\E
\n/xm, \n/xm,
like => { like => { binary_upgrade => 1, },
binary_upgrade => 1,
},
unlike => { unlike => {
clean => 1, clean => 1,
clean_if_exists => 1, clean_if_exists => 1,
...@@ -791,8 +673,7 @@ my %tests = ( ...@@ -791,8 +673,7 @@ my %tests = (
pg_dumpall_globals => 1, pg_dumpall_globals => 1,
schema_only => 1, schema_only => 1,
section_pre_data => 1, section_pre_data => 1,
section_post_data => 1, section_post_data => 1, }, },
}, },
'GRANT ALL ON regress_pg_dump_schema.test_func' => { 'GRANT ALL ON regress_pg_dump_schema.test_func' => {
regexp => qr/^ regexp => qr/^
...@@ -800,9 +681,7 @@ my %tests = ( ...@@ -800,9 +681,7 @@ my %tests = (
\QGRANT ALL ON FUNCTION test_func() TO regress_dump_test_role;\E\n \QGRANT ALL ON FUNCTION test_func() TO regress_dump_test_role;\E\n
\QSELECT pg_catalog.binary_upgrade_set_record_init_privs(false);\E \QSELECT pg_catalog.binary_upgrade_set_record_init_privs(false);\E
\n/xms, \n/xms,
like => { like => { binary_upgrade => 1, },
binary_upgrade => 1,
},
unlike => { unlike => {
clean => 1, clean => 1,
clean_if_exists => 1, clean_if_exists => 1,
...@@ -813,8 +692,7 @@ my %tests = ( ...@@ -813,8 +692,7 @@ my %tests = (
pg_dumpall_globals => 1, pg_dumpall_globals => 1,
schema_only => 1, schema_only => 1,
section_pre_data => 1, section_pre_data => 1,
section_post_data => 1, section_post_data => 1, }, },
}, },
'CREATE AGGREGATE regress_pg_dump_schema.test_agg' => { 'CREATE AGGREGATE regress_pg_dump_schema.test_agg' => {
regexp => qr/^ regexp => qr/^
...@@ -822,9 +700,7 @@ my %tests = ( ...@@ -822,9 +700,7 @@ my %tests = (
\n\s+\QSFUNC = int2_sum,\E \n\s+\QSFUNC = int2_sum,\E
\n\s+\QSTYPE = bigint\E \n\s+\QSTYPE = bigint\E
\n\);\n/xm, \n\);\n/xm,
like => { like => { binary_upgrade => 1, },
binary_upgrade => 1,
},
unlike => { unlike => {
clean => 1, clean => 1,
clean_if_exists => 1, clean_if_exists => 1,
...@@ -835,8 +711,7 @@ my %tests = ( ...@@ -835,8 +711,7 @@ my %tests = (
pg_dumpall_globals => 1, pg_dumpall_globals => 1,
schema_only => 1, schema_only => 1,
section_pre_data => 1, section_pre_data => 1,
section_post_data => 1, section_post_data => 1, }, },
}, },
'GRANT ALL ON regress_pg_dump_schema.test_agg' => { 'GRANT ALL ON regress_pg_dump_schema.test_agg' => {
regexp => qr/^ regexp => qr/^
...@@ -844,9 +719,7 @@ my %tests = ( ...@@ -844,9 +719,7 @@ my %tests = (
\QGRANT ALL ON FUNCTION test_agg(smallint) TO regress_dump_test_role;\E\n \QGRANT ALL ON FUNCTION test_agg(smallint) TO regress_dump_test_role;\E\n
\QSELECT pg_catalog.binary_upgrade_set_record_init_privs(false);\E \QSELECT pg_catalog.binary_upgrade_set_record_init_privs(false);\E
\n/xms, \n/xms,
like => { like => { binary_upgrade => 1, },
binary_upgrade => 1,
},
unlike => { unlike => {
clean => 1, clean => 1,
clean_if_exists => 1, clean_if_exists => 1,
...@@ -857,8 +730,7 @@ my %tests = ( ...@@ -857,8 +730,7 @@ my %tests = (
pg_dumpall_globals => 1, pg_dumpall_globals => 1,
schema_only => 1, schema_only => 1,
section_pre_data => 1, section_pre_data => 1,
section_post_data => 1, section_post_data => 1, }, },
}, },
# Objects not included in extension, part of schema created by extension # Objects not included in extension, part of schema created by extension
'CREATE TABLE regress_pg_dump_schema.external_tab' => { 'CREATE TABLE regress_pg_dump_schema.external_tab' => {
...@@ -878,13 +750,10 @@ my %tests = ( ...@@ -878,13 +750,10 @@ my %tests = (
no_owner => 1, no_owner => 1,
no_privs => 1, no_privs => 1,
schema_only => 1, schema_only => 1,
section_pre_data => 1, section_pre_data => 1, },
},
unlike => { unlike => {
pg_dumpall_globals => 1, pg_dumpall_globals => 1,
section_post_data => 1, section_post_data => 1, }, },);
}, },
);
######################################### #########################################
# Create a PG instance to test actually dumping from # Create a PG instance to test actually dumping from
......
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