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