Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
3be0a62f
Commit
3be0a62f
authored
Jun 12, 2016
by
Noah Misch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Finish pgindent run for 9.6: Perl files.
parent
b098abf9
Changes
31
Show whitespace changes
Inline
Side-by-side
Showing
31 changed files
with
1897 additions
and
2305 deletions
+1897
-2305
contrib/bloom/t/001_wal.pl
contrib/bloom/t/001_wal.pl
+10
-5
src/backend/storage/lmgr/generate-lwlocknames.pl
src/backend/storage/lmgr/generate-lwlocknames.pl
+4
-4
src/backend/utils/Gen_dummy_probes.pl
src/backend/utils/Gen_dummy_probes.pl
+1
-0
src/backend/utils/mb/Unicode/UCS_to_SJIS.pl
src/backend/utils/mb/Unicode/UCS_to_SJIS.pl
+2
-2
src/bin/pg_basebackup/t/010_pg_basebackup.pl
src/bin/pg_basebackup/t/010_pg_basebackup.pl
+2
-1
src/bin/pg_dump/t/001_basic.pl
src/bin/pg_dump/t/001_basic.pl
+16
-8
src/bin/pg_dump/t/002_pg_dump.pl
src/bin/pg_dump/t/002_pg_dump.pl
+1495
-1897
src/bin/pg_rewind/RewindTest.pm
src/bin/pg_rewind/RewindTest.pm
+1
-0
src/interfaces/ecpg/preproc/parse.pl
src/interfaces/ecpg/preproc/parse.pl
+2
-2
src/test/modules/commit_ts/t/001_base.pl
src/test/modules/commit_ts/t/001_base.pl
+8
-4
src/test/modules/commit_ts/t/002_standby.pl
src/test/modules/commit_ts/t/002_standby.pl
+21
-13
src/test/modules/commit_ts/t/003_standby_2.pl
src/test/modules/commit_ts/t/003_standby_2.pl
+18
-10
src/test/modules/test_pg_dump/t/001_base.pl
src/test/modules/test_pg_dump/t/001_base.pl
+193
-265
src/test/perl/PostgresNode.pm
src/test/perl/PostgresNode.pm
+8
-3
src/test/perl/RecursiveCopy.pm
src/test/perl/RecursiveCopy.pm
+3
-2
src/test/perl/TestLib.pm
src/test/perl/TestLib.pm
+1
-0
src/test/recovery/t/001_stream_rep.pl
src/test/recovery/t/001_stream_rep.pl
+6
-3
src/test/recovery/t/002_archiving.pl
src/test/recovery/t/002_archiving.pl
+2
-1
src/test/recovery/t/003_recovery_targets.pl
src/test/recovery/t/003_recovery_targets.pl
+2
-1
src/test/recovery/t/004_timeline_switch.pl
src/test/recovery/t/004_timeline_switch.pl
+2
-2
src/test/recovery/t/005_replay_delay.pl
src/test/recovery/t/005_replay_delay.pl
+8
-6
src/test/recovery/t/007_sync_rep.pl
src/test/recovery/t/007_sync_rep.pl
+21
-12
src/tools/copyright.pl
src/tools/copyright.pl
+2
-2
src/tools/git_changelog
src/tools/git_changelog
+21
-21
src/tools/msvc/Install.pm
src/tools/msvc/Install.pm
+2
-1
src/tools/msvc/Mkvcbuild.pm
src/tools/msvc/Mkvcbuild.pm
+13
-9
src/tools/msvc/Solution.pm
src/tools/msvc/Solution.pm
+8
-8
src/tools/msvc/build.pl
src/tools/msvc/build.pl
+2
-1
src/tools/msvc/config_default.pl
src/tools/msvc/config_default.pl
+1
-1
src/tools/msvc/pgflex.pl
src/tools/msvc/pgflex.pl
+2
-2
src/tools/msvc/vcregress.pl
src/tools/msvc/vcregress.pl
+20
-19
No files found.
contrib/bloom/t/001_wal.pl
View file @
3be0a62f
...
@@ -16,7 +16,7 @@ sub test_index_replay
...
@@ -16,7 +16,7 @@ sub test_index_replay
# Wait for standby to catch up
# Wait for standby to catch up
my
$applname
=
$node_standby
->
name
;
my
$applname
=
$node_standby
->
name
;
my
$caughtup_query
=
my
$caughtup_query
=
"
SELECT pg_current_xlog_location() <= write_location FROM pg_stat_replication WHERE application_name = '
$applname
';
";
"
SELECT pg_current_xlog_location() <= write_location FROM pg_stat_replication WHERE application_name = '
$applname
';
";
$node_master
->
poll_query_until
('
postgres
',
$caughtup_query
)
$node_master
->
poll_query_until
('
postgres
',
$caughtup_query
)
or
die
"
Timed out while waiting for standby 1 to catch up
";
or
die
"
Timed out while waiting for standby 1 to catch up
";
...
@@ -56,20 +56,25 @@ $node_standby->start;
...
@@ -56,20 +56,25 @@ $node_standby->start;
# Create some bloom index on master
# Create some bloom index on master
$node_master
->
psql
("
postgres
",
"
CREATE EXTENSION bloom;
");
$node_master
->
psql
("
postgres
",
"
CREATE EXTENSION bloom;
");
$node_master
->
psql
("
postgres
",
"
CREATE TABLE tst (i int4, t text);
");
$node_master
->
psql
("
postgres
",
"
CREATE TABLE tst (i int4, t text);
");
$node_master
->
psql
("
postgres
",
"
INSERT INTO tst SELECT i%10, substr(md5(i::text), 1, 1) FROM generate_series(1,100000) i;
");
$node_master
->
psql
("
postgres
",
$node_master
->
psql
("
postgres
",
"
CREATE INDEX bloomidx ON tst USING bloom (i, t) WITH (col1 = 3);
");
"
INSERT INTO tst SELECT i%10, substr(md5(i::text), 1, 1) FROM generate_series(1,100000) i;
"
);
$node_master
->
psql
("
postgres
",
"
CREATE INDEX bloomidx ON tst USING bloom (i, t) WITH (col1 = 3);
");
# Test that queries give same result
# Test that queries give same result
test_index_replay
('
initial
');
test_index_replay
('
initial
');
# Run 10 cycles of table modification. Run test queries after each modification.
# Run 10 cycles of table modification. Run test queries after each modification.
for
my
$i
(
1
..
10
)
for
my
$i
(
1
..
10
)
{
{
$node_master
->
psql
("
postgres
",
"
DELETE FROM tst WHERE i =
$i
;
");
$node_master
->
psql
("
postgres
",
"
DELETE FROM tst WHERE i =
$i
;
");
test_index_replay
("
delete
$i
");
test_index_replay
("
delete
$i
");
$node_master
->
psql
("
postgres
",
"
VACUUM tst;
");
$node_master
->
psql
("
postgres
",
"
VACUUM tst;
");
test_index_replay
("
vacuum
$i
");
test_index_replay
("
vacuum
$i
");
my
(
$start
,
$end
)
=
(
100001
+
(
$i
-
1
)
*
10000
,
100000
+
$i
*
10000
);
my
(
$start
,
$end
)
=
(
100001
+
(
$i
-
1
)
*
10000
,
100000
+
$i
*
10000
);
$node_master
->
psql
("
postgres
",
"
INSERT INTO tst SELECT i%10, substr(md5(i::text), 1, 1) FROM generate_series(
$start
,
$end
) i;
");
$node_master
->
psql
("
postgres
",
"
INSERT INTO tst SELECT i%10, substr(md5(i::text), 1, 1) FROM generate_series(
$start
,
$end
) i;
"
);
test_index_replay
("
insert
$i
");
test_index_replay
("
insert
$i
");
}
}
src/backend/storage/lmgr/generate-lwlocknames.pl
View file @
3be0a62f
...
@@ -18,7 +18,7 @@ open H, '>', $htmp or die "Could not open $htmp: $!";
...
@@ -18,7 +18,7 @@ open H, '>', $htmp or die "Could not open $htmp: $!";
open
C
,
'
>
',
$ctmp
or
die
"
Could not open
$ctmp
: $!
";
open
C
,
'
>
',
$ctmp
or
die
"
Could not open
$ctmp
: $!
";
my
$autogen
=
my
$autogen
=
"
/* autogenerated from src/backend/storage/lmgr/lwlocknames.txt, do not edit */
\n
";
"
/* autogenerated from src/backend/storage/lmgr/lwlocknames.txt, do not edit */
\n
";
print
H
$autogen
;
print
H
$autogen
;
print
H
"
/* there is deliberately not an #ifndef LWLOCKNAMES_H here */
\n\n
";
print
H
"
/* there is deliberately not an #ifndef LWLOCKNAMES_H here */
\n\n
";
print
C
$autogen
,
"
\n
";
print
C
$autogen
,
"
\n
";
...
...
src/backend/utils/Gen_dummy_probes.pl
View file @
3be0a62f
...
@@ -224,6 +224,7 @@ sub printQ()
...
@@ -224,6 +224,7 @@ sub printQ()
{
{
if
(
ref
(
$q
))
if
(
ref
(
$q
))
{
{
# flush open w files so that reading this file gets it all
# flush open w files so that reading this file gets it all
if
(
exists
(
$wFiles
{
$$q
})
&&
$wFiles
{
$$q
}
ne
'')
if
(
exists
(
$wFiles
{
$$q
})
&&
$wFiles
{
$$q
}
ne
'')
{
{
...
...
src/backend/utils/mb/Unicode/UCS_to_SJIS.pl
View file @
3be0a62f
...
@@ -54,8 +54,8 @@ while (<FILE>)
...
@@ -54,8 +54,8 @@ while (<FILE>)
||
(
(
$code
>=
0x879a
)
||
(
(
$code
>=
0x879a
)
&&
(
$code
<=
0x879c
)))
&&
(
$code
<=
0x879c
)))
{
{
printf
STDERR
printf
STDERR
"
Warning: duplicate UTF8: UCS=0x%04x SJIS=0x%04x
\n
",
"
Warning: duplicate UTF8: UCS=0x%04x SJIS=0x%04x
\n
",
$ucs
,
$ucs
,
$code
;
$code
;
next
;
next
;
}
}
...
...
src/bin/pg_basebackup/t/010_pg_basebackup.pl
View file @
3be0a62f
...
@@ -114,7 +114,8 @@ SKIP:
...
@@ -114,7 +114,8 @@ SKIP:
mkdir
"
$tempdir
/tblspc1
";
mkdir
"
$tempdir
/tblspc1
";
$node
->
safe_psql
('
postgres
',
$node
->
safe_psql
('
postgres
',
"
CREATE TABLESPACE tblspc1 LOCATION '
$shorter_tempdir
/tblspc1';
");
"
CREATE TABLESPACE tblspc1 LOCATION '
$shorter_tempdir
/tblspc1';
");
$node
->
safe_psql
('
postgres
',
"
CREATE TABLE test1 (a int) TABLESPACE tblspc1;
");
$node
->
safe_psql
('
postgres
',
"
CREATE TABLE test1 (a int) TABLESPACE tblspc1;
");
$node
->
command_ok
([
'
pg_basebackup
',
'
-D
',
"
$tempdir
/tarbackup2
",
'
-Ft
'
],
$node
->
command_ok
([
'
pg_basebackup
',
'
-D
',
"
$tempdir
/tarbackup2
",
'
-Ft
'
],
'
tar format with tablespaces
');
'
tar format with tablespaces
');
ok
(
-
f
"
$tempdir
/tarbackup2/base.tar
",
'
backup tar was created
');
ok
(
-
f
"
$tempdir
/tarbackup2/base.tar
",
'
backup tar was created
');
...
...
src/bin/pg_dump/t/001_basic.pl
View file @
3be0a62f
...
@@ -23,14 +23,22 @@ program_options_handling_ok('pg_dump');
...
@@ -23,14 +23,22 @@ program_options_handling_ok('pg_dump');
command_exit_is
([
'
pg_dump
',
'
qqq
',
'
abc
'
],
command_exit_is
([
'
pg_dump
',
'
qqq
',
'
abc
'
],
1
,
'
pg_dump: too many command-line arguments (first is "asd")
');
1
,
'
pg_dump: too many command-line arguments (first is "asd")
');
command_exit_is
([
'
pg_dump
',
'
-s
',
'
-a
'
],
command_exit_is
(
1
,
'
pg_dump: options -s/--schema-only and -a/--data-only cannot be used together
');
[
'
pg_dump
',
'
-s
',
'
-a
'
],
1
,
command_exit_is
([
'
pg_dump
',
'
-c
',
'
-a
'
],
'
pg_dump: options -s/--schema-only and -a/--data-only cannot be used together
'
1
,
'
pg_dump: options -c/--clean and -a/--data-only cannot be used together
');
);
command_exit_is
([
'
pg_dump
',
'
--inserts
',
'
-o
'
],
command_exit_is
(
1
,
'
pg_dump: options --inserts/--column-inserts and -o/--oids cannot be used together
');
[
'
pg_dump
',
'
-c
',
'
-a
'
],
1
,
'
pg_dump: options -c/--clean and -a/--data-only cannot be used together
');
command_exit_is
(
[
'
pg_dump
',
'
--inserts
',
'
-o
'
],
1
,
'
pg_dump: options --inserts/--column-inserts and -o/--oids cannot be used together
'
);
command_exit_is
([
'
pg_dump
',
'
--if-exists
'
],
command_exit_is
([
'
pg_dump
',
'
--if-exists
'
],
1
,
'
pg_dump: option --if-exists requires option -c/--clean
');
1
,
'
pg_dump: option --if-exists requires option -c/--clean
');
...
...
src/bin/pg_dump/t/002_pg_dump.pl
View file @
3be0a62f
...
@@ -43,16 +43,14 @@ my %pgdump_runs = (
...
@@ -43,16 +43,14 @@ my %pgdump_runs = (
'
--schema-only
',
'
--schema-only
',
'
--binary-upgrade
',
'
--binary-upgrade
',
'
-d
',
'
postgres
',
# alternative way to specify database
'
-d
',
'
postgres
',
# alternative way to specify database
],
],
},
},
clean
=>
{
clean
=>
{
dump_cmd
=>
[
dump_cmd
=>
[
'
pg_dump
',
'
pg_dump
',
'
-f
',
"
$tempdir
/clean.sql
",
'
-f
',
"
$tempdir
/clean.sql
",
'
-c
',
'
-c
',
'
-d
',
'
postgres
',
# alternative way to specify database
'
-d
',
'
postgres
',
# alternative way to specify database
],
],
},
},
clean_if_exists
=>
{
clean_if_exists
=>
{
dump_cmd
=>
[
dump_cmd
=>
[
'
pg_dump
',
'
pg_dump
',
...
@@ -60,224 +58,130 @@ my %pgdump_runs = (
...
@@ -60,224 +58,130 @@ my %pgdump_runs = (
'
-c
',
'
-c
',
'
--if-exists
',
'
--if-exists
',
'
-E
',
'
UTF8
',
# no-op, just tests that option is accepted
'
-E
',
'
UTF8
',
# no-op, just tests that option is accepted
'
postgres
',
'
postgres
',
],
},
],
},
column_inserts
=>
{
column_inserts
=>
{
dump_cmd
=>
[
dump_cmd
=>
[
'
pg_dump
',
'
pg_dump
',
'
-f
',
'
-f
',
"
$tempdir
/column_inserts.sql
",
"
$tempdir
/column_inserts.sql
",
'
-a
',
'
-a
',
'
--column-inserts
',
'
postgres
',
],
},
'
--column-inserts
',
'
postgres
',
],
},
createdb
=>
{
createdb
=>
{
dump_cmd
=>
[
dump_cmd
=>
[
'
pg_dump
',
'
pg_dump
',
'
-f
',
"
$tempdir
/createdb.sql
",
'
-f
',
"
$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
",
'
-f
',
"
$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
',
'
-f
',
'
-Fc
',
"
$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
",
'
-f
',
"
$tempdir
/defaults_custom_format.dump
",
"
$tempdir
/defaults_custom_format.sql
",
],
"
$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
',
'
-f
',
"
$tempdir
/defaults_dir_format
",
'
-Fd
',
'
postgres
',
],
'
-f
',
"
$tempdir
/defaults_dir_format
",
'
postgres
',
],
restore_cmd
=>
[
restore_cmd
=>
[
'
pg_restore
',
'
pg_restore
',
'
-f
',
"
$tempdir
/defaults_dir_format.sql
",
'
-f
',
"
$tempdir
/defaults_dir_format
",
"
$tempdir
/defaults_dir_format.sql
",
],
"
$tempdir
/defaults_dir_format
",
],
},
},
defaults_parallel
=>
{
defaults_parallel
=>
{
test_key
=>
'
defaults
',
test_key
=>
'
defaults
',
dump_cmd
=>
[
dump_cmd
=>
[
'
pg_dump
',
'
pg_dump
',
'
-Fd
',
'
-j2
',
'
-f
',
"
$tempdir
/defaults_parallel
",
'
-Fd
',
'
postgres
',
],
'
-j2
',
'
-f
',
"
$tempdir
/defaults_parallel
",
'
postgres
',
],
restore_cmd
=>
[
restore_cmd
=>
[
'
pg_restore
',
'
pg_restore
',
'
-f
',
'
-f
',
"
$tempdir
/defaults_parallel.sql
",
"
$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
',
'
-f
',
"
$tempdir
/defaults_tar_format.tar
",
'
-Ft
',
'
postgres
',
],
'
-f
',
"
$tempdir
/defaults_tar_format.tar
",
'
postgres
',
],
restore_cmd
=>
[
restore_cmd
=>
[
'
pg_restore
',
'
pg_restore
',
'
-f
',
"
$tempdir
/defaults_tar_format.sql
",
'
-f
',
"
$tempdir
/defaults_tar_format.tar
",
"
$tempdir
/defaults_tar_format.sql
",
],
"
$tempdir
/defaults_tar_format.tar
",
],
},
},
exclude_dump_test_schema
=>
{
exclude_dump_test_schema
=>
{
dump_cmd
=>
[
dump_cmd
=>
[
'
pg_dump
',
'
pg_dump
',
'
-f
',
"
$tempdir
/exclude_dump_test_schema.sql
",
'
-f
',
"
$tempdir
/exclude_dump_test_schema.sql
",
'
-N
',
'
dump_test
',
'
postgres
',
],
},
'
-N
',
'
dump_test
',
'
postgres
',
],
},
exclude_test_table
=>
{
exclude_test_table
=>
{
dump_cmd
=>
[
dump_cmd
=>
[
'
pg_dump
',
'
pg_dump
',
'
-f
',
'
-f
',
"
$tempdir
/exclude_test_table.sql
",
"
$tempdir
/exclude_test_table.sql
",
'
-T
',
'
-T
',
'
dump_test.test_table
',
'
dump_test.test_table
',
'
postgres
',
],
},
'
postgres
',
],
},
exclude_test_table_data
=>
{
exclude_test_table_data
=>
{
dump_cmd
=>
[
dump_cmd
=>
[
'
pg_dump
',
'
pg_dump
',
'
-f
',
'
-f
',
"
$tempdir
/exclude_test_table_data.sql
",
"
$tempdir
/exclude_test_table_data.sql
",
'
--exclude-table-data=dump_test.test_table
',
'
--exclude-table-data=dump_test.test_table
',
'
postgres
',
],
},
'
postgres
',
],
},
pg_dumpall_globals
=>
{
pg_dumpall_globals
=>
{
dump_cmd
=>
[
dump_cmd
=>
'
pg_dumpall
',
[
'
pg_dumpall
',
'
-f
',
"
$tempdir
/pg_dumpall_globals.sql
",
'
-g
',
],
},
'
-f
',
"
$tempdir
/pg_dumpall_globals.sql
",
'
-g
',
],
},
pg_dumpall_globals_clean
=>
{
pg_dumpall_globals_clean
=>
{
dump_cmd
=>
[
dump_cmd
=>
[
'
pg_dumpall
',
'
pg_dumpall
',
'
-f
',
"
$tempdir
/pg_dumpall_globals_clean.sql
",
'
-f
',
"
$tempdir
/pg_dumpall_globals_clean.sql
",
'
-g
',
'
-c
',
],
},
'
-g
',
'
-c
',
],
},
no_privs
=>
{
no_privs
=>
{
dump_cmd
=>
[
dump_cmd
=>
'
pg_dump
',
[
'
pg_dump
',
'
-f
',
"
$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
',
'
-f
',
"
$tempdir
/no_owner.sql
",
'
-O
',
'
postgres
',
],
},
'
-f
',
"
$tempdir
/no_owner.sql
",
'
-O
',
'
postgres
',
],
},
only_dump_test_schema
=>
{
only_dump_test_schema
=>
{
dump_cmd
=>
[
dump_cmd
=>
[
'
pg_dump
',
'
pg_dump
',
'
-f
',
"
$tempdir
/only_dump_test_schema.sql
",
'
-f
',
"
$tempdir
/only_dump_test_schema.sql
",
'
-n
',
'
dump_test
',
'
postgres
',
],
},
'
-n
',
'
dump_test
',
'
postgres
',
],
},
only_dump_test_table
=>
{
only_dump_test_table
=>
{
dump_cmd
=>
[
dump_cmd
=>
[
'
pg_dump
',
'
pg_dump
',
'
-f
',
"
$tempdir
/only_dump_test_table.sql
",
'
-f
',
"
$tempdir
/only_dump_test_table.sql
",
'
-t
',
'
dump_test.test_table
',
'
--lock-wait-timeout=1000000
',
'
-t
',
'
dump_test.test_table
',
'
postgres
',
],
},
'
--lock-wait-timeout=1000000
',
'
postgres
',
],
},
role
=>
{
role
=>
{
dump_cmd
=>
[
dump_cmd
=>
[
'
pg_dump
',
'
pg_dump
',
'
-f
',
'
-f
',
"
$tempdir
/role.sql
",
"
$tempdir
/role.sql
",
'
--role=dump_test
',
'
--role=dump_test
',
'
--schema=dump_test_second_schema
',
'
postgres
',
],
},
'
--schema=dump_test_second_schema
',
'
postgres
',
],
},
schema_only
=>
{
schema_only
=>
{
dump_cmd
=>
[
dump_cmd
=>
'
pg_dump
',
[
'
pg_dump
',
'
-f
',
"
$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
',
'
-f
',
"
$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
',
'
-f
',
'
-f
',
"
$tempdir
/section_data.sql
",
"
$tempdir
/section_data.sql
",
'
--section=data
',
'
--section=data
',
'
postgres
',
],
},
'
postgres
',
],
},
section_post_data
=>
{
section_post_data
=>
{
dump_cmd
=>
[
dump_cmd
=>
[
'
pg_dump
',
'
pg_dump
',
'
-f
',
"
$tempdir
/section_post_data.sql
",
'
-f
',
"
$tempdir
/section_post_data.sql
",
'
--section=post-data
',
'
postgres
',
],
},
'
--section=post-data
',
'
postgres
',
],
},
test_schema_plus_blobs
=>
{
test_schema_plus_blobs
=>
{
dump_cmd
=>
[
dump_cmd
=>
[
'
pg_dump
',
'
pg_dump
',
'
-f
',
"
$tempdir
/test_schema_plus_blobs.sql
",
'
-f
',
"
$tempdir
/test_schema_plus_blobs.sql
",
'
-n
',
'
dump_test
',
'
-b
',
'
postgres
',
],
},);
'
-n
',
'
dump_test
',
'
-b
',
'
postgres
',
],
},
);
###############################################################
###############################################################
# Definition of the tests to run.
# Definition of the tests to run.
...
@@ -338,8 +242,7 @@ my %tests = (
...
@@ -338,8 +242,7 @@ my %tests = (
only_dump_test_schema
=>
1
,
only_dump_test_schema
=>
1
,
schema_only
=>
1
,
schema_only
=>
1
,
section_post_data
=>
1
,
section_post_data
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
},
},
unlike
=>
{
unlike
=>
{
exclude_dump_test_schema
=>
1
,
exclude_dump_test_schema
=>
1
,
no_privs
=>
1
,
no_privs
=>
1
,
...
@@ -347,9 +250,7 @@ my %tests = (
...
@@ -347,9 +250,7 @@ my %tests = (
pg_dumpall_globals
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals_clean
=>
1
,
pg_dumpall_globals_clean
=>
1
,
section_pre_data
=>
1
,
section_pre_data
=>
1
,
section_data
=>
1
,
section_data
=>
1
,
},
},
},
},
'
ALTER ROLE dump_test
'
=>
{
'
ALTER ROLE dump_test
'
=>
{
regexp
=>
qr/^
regexp
=>
qr/^
\QALTER ROLE dump_test WITH \E
\QALTER ROLE dump_test WITH \E
...
@@ -358,8 +259,7 @@ my %tests = (
...
@@ -358,8 +259,7 @@ my %tests = (
/
xm
,
/
xm
,
like
=>
{
like
=>
{
pg_dumpall_globals
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals_clean
=>
1
,
pg_dumpall_globals_clean
=>
1
,
},
},
unlike
=>
{
unlike
=>
{
binary_upgrade
=>
1
,
binary_upgrade
=>
1
,
clean
=>
1
,
clean
=>
1
,
...
@@ -376,9 +276,7 @@ my %tests = (
...
@@ -376,9 +276,7 @@ my %tests = (
schema_only
=>
1
,
schema_only
=>
1
,
section_pre_data
=>
1
,
section_pre_data
=>
1
,
section_post_data
=>
1
,
section_post_data
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
},
},
},
},
'
ALTER FUNCTION dump_test.pltestlang_call_handler() OWNER TO
'
=>
{
'
ALTER FUNCTION dump_test.pltestlang_call_handler() OWNER TO
'
=>
{
regexp
=>
qr/^
regexp
=>
qr/^
\QALTER FUNCTION dump_test.pltestlang_call_handler() \E
\QALTER FUNCTION dump_test.pltestlang_call_handler() \E
...
@@ -396,13 +294,10 @@ my %tests = (
...
@@ -396,13 +294,10 @@ my %tests = (
only_dump_test_schema
=>
1
,
only_dump_test_schema
=>
1
,
schema_only
=>
1
,
schema_only
=>
1
,
section_pre_data
=>
1
,
section_pre_data
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
},
},
unlike
=>
{
unlike
=>
{
exclude_dump_test_schema
=>
1
,
exclude_dump_test_schema
=>
1
,
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
},
},
},
},
'
ALTER PROCEDURAL LANGUAGE pltestlang OWNER TO
'
=>
{
'
ALTER PROCEDURAL LANGUAGE pltestlang OWNER TO
'
=>
{
regexp
=>
qr/^ALTER PROCEDURAL LANGUAGE pltestlang OWNER TO .*;/
m,
regexp
=>
qr/^ALTER PROCEDURAL LANGUAGE pltestlang OWNER TO .*;/
m,
like => {
like => {
...
@@ -416,14 +311,11 @@ my %tests = (
...
@@ -416,14 +311,11 @@ my %tests = (
exclude_test_table_data
=>
1
,
exclude_test_table_data
=>
1
,
no_privs
=>
1
,
no_privs
=>
1
,
schema_only
=>
1
,
schema_only
=>
1
,
section_pre_data
=>
1
,
section_pre_data
=>
1
,
},
},
unlike
=>
{
unlike
=>
{
only_dump_test_schema
=>
1
,
only_dump_test_schema
=>
1
,
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
},
},
},
},
'
ALTER SCHEMA dump_test OWNER TO
'
=>
{
'
ALTER SCHEMA dump_test OWNER TO
'
=>
{
regexp
=>
qr/^ALTER SCHEMA dump_test OWNER TO .*;/
m,
regexp
=>
qr/^ALTER SCHEMA dump_test OWNER TO .*;/
m,
like => {
like => {
...
@@ -438,13 +330,10 @@ my %tests = (
...
@@ -438,13 +330,10 @@ my %tests = (
only_dump_test_schema
=>
1
,
only_dump_test_schema
=>
1
,
schema_only
=>
1
,
schema_only
=>
1
,
section_pre_data
=>
1
,
section_pre_data
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
},
},
unlike
=>
{
unlike
=>
{
exclude_dump_test_schema
=>
1
,
exclude_dump_test_schema
=>
1
,
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
},
},
},
},
'
ALTER SCHEMA dump_test_second_schema OWNER TO
'
=>
{
'
ALTER SCHEMA dump_test_second_schema OWNER TO
'
=>
{
regexp
=>
qr/^ALTER SCHEMA dump_test_second_schema OWNER TO .*;/
m,
regexp
=>
qr/^ALTER SCHEMA dump_test_second_schema OWNER TO .*;/
m,
like => {
like => {
...
@@ -458,14 +347,11 @@ my %tests = (
...
@@ -458,14 +347,11 @@ my %tests = (
exclude_test_table_data
=>
1
,
exclude_test_table_data
=>
1
,
no_privs
=>
1
,
no_privs
=>
1
,
schema_only
=>
1
,
schema_only
=>
1
,
section_pre_data
=>
1
,
section_pre_data
=>
1
,
},
},
unlike
=>
{
unlike
=>
{
only_dump_test_schema
=>
1
,
only_dump_test_schema
=>
1
,
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
},
},
},
},
'
ALTER TABLE ONLY test_table ADD CONSTRAINT ... PRIMARY KEY
'
=>
{
'
ALTER TABLE ONLY test_table ADD CONSTRAINT ... PRIMARY KEY
'
=>
{
regexp
=>
qr/^
regexp
=>
qr/^
\QALTER TABLE ONLY test_table\E \n^\s+
\QALTER TABLE ONLY test_table\E \n^\s+
...
@@ -483,15 +369,12 @@ my %tests = (
...
@@ -483,15 +369,12 @@ my %tests = (
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
schema_only
=>
1
,
schema_only
=>
1
,
section_post_data
=>
1
,
section_post_data
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
},
},
unlike
=>
{
unlike
=>
{
exclude_dump_test_schema
=>
1
,
exclude_dump_test_schema
=>
1
,
exclude_test_table
=>
1
,
exclude_test_table
=>
1
,
section_pre_data
=>
1
,
section_pre_data
=>
1
,
section_data
=>
1
,
section_data
=>
1
,
},
},
},
},
'
ALTER TABLE test_table OWNER TO
'
=>
{
'
ALTER TABLE test_table OWNER TO
'
=>
{
regexp
=>
qr/^ALTER TABLE test_table OWNER TO .*;/
m,
regexp
=>
qr/^ALTER TABLE test_table OWNER TO .*;/
m,
like => {
like => {
...
@@ -506,13 +389,10 @@ my %tests = (
...
@@ -506,13 +389,10 @@ my %tests = (
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
schema_only
=>
1
,
schema_only
=>
1
,
section_pre_data
=>
1
,
section_pre_data
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
},
},
unlike
=>
{
unlike
=>
{
exclude_dump_test_schema
=>
1
,
exclude_dump_test_schema
=>
1
,
exclude_test_table
=>
1
,
exclude_test_table
=>
1
,
},
},
},
},
'
ALTER TABLE test_table ENABLE ROW LEVEL SECURITY
'
=>
{
'
ALTER TABLE test_table ENABLE ROW LEVEL SECURITY
'
=>
{
create_order
=>
23
,
create_order
=>
23
,
create_sql
=>
'
ALTER TABLE dump_test.test_table
create_sql
=>
'
ALTER TABLE dump_test.test_table
...
@@ -530,14 +410,11 @@ my %tests = (
...
@@ -530,14 +410,11 @@ my %tests = (
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
schema_only
=>
1
,
schema_only
=>
1
,
section_post_data
=>
1
,
section_post_data
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
},
},
unlike
=>
{
unlike
=>
{
section_pre_data
=>
1
,
section_pre_data
=>
1
,
exclude_dump_test_schema
=>
1
,
exclude_dump_test_schema
=>
1
,
exclude_test_table
=>
1
,
exclude_test_table
=>
1
,
},
},
},
},
'
ALTER TABLE test_second_table OWNER TO
'
=>
{
'
ALTER TABLE test_second_table OWNER TO
'
=>
{
regexp
=>
qr/^ALTER TABLE test_second_table OWNER TO .*;/
m,
regexp
=>
qr/^ALTER TABLE test_second_table OWNER TO .*;/
m,
like => {
like => {
...
@@ -552,13 +429,10 @@ my %tests = (
...
@@ -552,13 +429,10 @@ my %tests = (
only_dump_test_schema
=>
1
,
only_dump_test_schema
=>
1
,
schema_only
=>
1
,
schema_only
=>
1
,
section_pre_data
=>
1
,
section_pre_data
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
},
},
unlike
=>
{
unlike
=>
{
exclude_dump_test_schema
=>
1
,
exclude_dump_test_schema
=>
1
,
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
},
},
},
},
'
ALTER TABLE test_third_table OWNER TO
'
=>
{
'
ALTER TABLE test_third_table OWNER TO
'
=>
{
regexp
=>
qr/^ALTER TABLE test_third_table OWNER TO .*;/
m,
regexp
=>
qr/^ALTER TABLE test_third_table OWNER TO .*;/
m,
like => {
like => {
...
@@ -572,81 +446,76 @@ my %tests = (
...
@@ -572,81 +446,76 @@ my %tests = (
exclude_test_table_data
=>
1
,
exclude_test_table_data
=>
1
,
no_privs
=>
1
,
no_privs
=>
1
,
schema_only
=>
1
,
schema_only
=>
1
,
section_pre_data
=>
1
,
section_pre_data
=>
1
,
},
},
unlike
=>
{
unlike
=>
{
only_dump_test_schema
=>
1
,
only_dump_test_schema
=>
1
,
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
},
},
},
},
# catch-all for ALTER ... OWNER (except LARGE OBJECTs)
# catch-all for ALTER ... OWNER (except LARGE OBJECTs)
'
ALTER ... OWNER commands (except LARGE OBJECTs)
'
=>
{
'
ALTER ... OWNER commands (except LARGE OBJECTs)
'
=>
{
regexp
=>
qr/^ALTER (?!LARGE OBJECT)(.*) OWNER TO .*;/
m,
regexp
=>
qr/^ALTER (?!LARGE OBJECT)(.*) OWNER TO .*;/
m,
like
=> { },
# use more-specific options above
like
=> {},
# use more-specific options above
unlike
=>
{
unlike
=>
{
column_inserts
=>
1
,
column_inserts
=>
1
,
data_only
=>
1
,
data_only
=>
1
,
section_data
=>
1
,
section_data
=>
1
,
},
},
},
},
# catch-all for ALTER TABLE ...
# catch-all for ALTER TABLE ...
'
ALTER TABLE ... commands
'
=>
{
'
ALTER TABLE ... commands
'
=>
{
regexp
=>
qr/^ALTER TABLE .*;/
m,
regexp
=>
qr/^ALTER TABLE .*;/
m,
like
=> { },
# use more-specific options above
like
=> {},
# use more-specific options above
unlike
=>
{
unlike
=>
{
column_inserts
=>
1
,
column_inserts
=>
1
,
data_only
=>
1
,
data_only
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals_clean
=>
1
,
pg_dumpall_globals_clean
=>
1
,
section_data
=>
1
,
section_data
=>
1
,
},
},
},
},
# catch-all for ALTER ... OWNER
# catch-all for ALTER ... OWNER
'
ALTER ... OWNER commands
'
=>
{
'
ALTER ... OWNER commands
'
=>
{
regexp
=>
qr/^ALTER .* OWNER TO .*;/
m,
regexp
=>
qr/^ALTER .* OWNER TO .*;/
m,
like
=> { },
# use more-specific options above
like
=> {},
# use more-specific options above
unlike
=>
{
unlike
=>
{
no_owner
=>
1
,
no_owner
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals_clean
=>
1
,
pg_dumpall_globals_clean
=>
1
,
section_post_data
=>
1
,
section_post_data
=>
1
,
},
},
},
},
# 'BLOB load (contents are of test_table)' => {
# 'BLOB load (contents are of test_table)' => {
# create_order => 14,
# create_order => 14,
# create_sql =>
# create_sql =>
# "\\o '$tempdir/large_object_test.sql'\n"
# "\\o '$tempdir/large_object_test.sql'\n"
# . "table dump_test.test_table;\n"
# . "table dump_test.test_table;\n"
# . "\\o\n"
# . "\\o\n"
# . "\\lo_import '$tempdir/large_object_test.sql'\n",
# . "\\lo_import '$tempdir/large_object_test.sql'\n",
# regexp => qr/^
# regexp => qr/^
# \QSELECT pg_catalog.lo_open\E \('\d+',\ \d+\);\n
# \QSELECT pg_catalog.lo_open\E \('\d+',\ \d+\);\n
# \QSELECT pg_catalog.lowrite(0, \E
# \QSELECT pg_catalog.lowrite(0, \E
# \Q'\x310a320a330a340a350a360a370a380a390a');\E\n
# \Q'\x310a320a330a340a350a360a370a380a390a');\E\n
# \QSELECT pg_catalog.lo_close(0);\E
# \QSELECT pg_catalog.lo_close(0);\E
# /xm,
# /xm,
# like => {
# like => {
# clean => 1,
# clean => 1,
# clean_if_exists => 1,
# clean_if_exists => 1,
# createdb => 1,
# createdb => 1,
# defaults => 1,
# defaults => 1,
# exclude_dump_test_schema => 1,
# exclude_dump_test_schema => 1,
# exclude_test_table => 1,
# exclude_test_table => 1,
# exclude_test_table_data => 1,
# exclude_test_table_data => 1,
# no_privs => 1,
# no_privs => 1,
# section_data => 1,
# section_data => 1,
# test_schema_plus_blobs => 1,
# test_schema_plus_blobs => 1,
# },
# },
# unlike => {
# unlike => {
# binary_upgrade => 1,
# binary_upgrade => 1,
# only_dump_test_schema => 1,
# only_dump_test_schema => 1,
# only_dump_test_table => 1,
# only_dump_test_table => 1,
# pg_dumpall_globals => 1,
# pg_dumpall_globals => 1,
# schema_only => 1,
# schema_only => 1,
# section_post_data => 1,
# section_post_data => 1,
# },
# },
# },
# },
'
COMMENT ON DATABASE postgres
'
=>
{
'
COMMENT ON DATABASE postgres
'
=>
{
regexp
=>
qr/^COMMENT ON DATABASE postgres IS .*;/
m,
regexp
=>
qr/^COMMENT ON DATABASE postgres IS .*;/
m,
like => {
like => {
...
@@ -661,13 +530,10 @@ my %tests = (
...
@@ -661,13 +530,10 @@ 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
=>
{
only_dump_test_schema
=>
1
,
only_dump_test_schema
=>
1
,
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
},
},
},
},
'
COMMENT ON EXTENSION plpgsql
'
=>
{
'
COMMENT ON EXTENSION plpgsql
'
=>
{
regexp
=>
qr/^COMMENT ON EXTENSION plpgsql IS .*;/
m,
regexp
=>
qr/^COMMENT ON EXTENSION plpgsql IS .*;/
m,
like => {
like => {
...
@@ -681,14 +547,11 @@ my %tests = (
...
@@ -681,14 +547,11 @@ 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
,
only_dump_test_schema
=>
1
,
only_dump_test_schema
=>
1
,
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
},
},
},
},
'
COMMENT ON TABLE dump_test.test_table
'
=>
{
'
COMMENT ON TABLE dump_test.test_table
'
=>
{
create_order
=>
36
,
create_order
=>
36
,
create_sql
=>
'
COMMENT ON TABLE dump_test.test_table
create_sql
=>
'
COMMENT ON TABLE dump_test.test_table
...
@@ -706,13 +569,10 @@ my %tests = (
...
@@ -706,13 +569,10 @@ my %tests = (
only_dump_test_schema
=>
1
,
only_dump_test_schema
=>
1
,
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
schema_only
=>
1
,
schema_only
=>
1
,
section_pre_data
=>
1
,
section_pre_data
=>
1
,
},
},
unlike
=>
{
unlike
=>
{
exclude_dump_test_schema
=>
1
,
exclude_dump_test_schema
=>
1
,
exclude_test_table
=>
1
,
exclude_test_table
=>
1
,
},
},
},
},
'
COMMENT ON COLUMN dump_test.test_table.col1
'
=>
{
'
COMMENT ON COLUMN dump_test.test_table.col1
'
=>
{
create_order
=>
36
,
create_order
=>
36
,
create_sql
=>
'
COMMENT ON COLUMN dump_test.test_table.col1
create_sql
=>
'
COMMENT ON COLUMN dump_test.test_table.col1
...
@@ -732,13 +592,10 @@ my %tests = (
...
@@ -732,13 +592,10 @@ my %tests = (
only_dump_test_schema
=>
1
,
only_dump_test_schema
=>
1
,
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
schema_only
=>
1
,
schema_only
=>
1
,
section_pre_data
=>
1
,
section_pre_data
=>
1
,
},
},
unlike
=>
{
unlike
=>
{
exclude_dump_test_schema
=>
1
,
exclude_dump_test_schema
=>
1
,
exclude_test_table
=>
1
,
exclude_test_table
=>
1
,
},
},
},
},
'
COMMENT ON COLUMN dump_test.composite.f1
'
=>
{
'
COMMENT ON COLUMN dump_test.composite.f1
'
=>
{
create_order
=>
44
,
create_order
=>
44
,
create_sql
=>
'
COMMENT ON COLUMN dump_test.composite.f1
create_sql
=>
'
COMMENT ON COLUMN dump_test.composite.f1
...
@@ -758,30 +615,25 @@ my %tests = (
...
@@ -758,30 +615,25 @@ my %tests = (
no_owner
=>
1
,
no_owner
=>
1
,
only_dump_test_schema
=>
1
,
only_dump_test_schema
=>
1
,
schema_only
=>
1
,
schema_only
=>
1
,
section_pre_data
=>
1
,
section_pre_data
=>
1
,
},
},
unlike
=>
{
unlike
=>
{
exclude_dump_test_schema
=>
1
,
exclude_dump_test_schema
=>
1
,
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
},
},
},
},
# catch-all for COMMENTs
# catch-all for COMMENTs
'
COMMENT commands
'
=>
{
'
COMMENT commands
'
=>
{
regexp
=>
qr/^COMMENT ON /
m,
regexp
=>
qr/^COMMENT ON /
m,
like
=> { },
# use more-specific options above
like
=> {},
# use more-specific options above
unlike
=>
{
unlike
=>
{
column_inserts
=>
1
,
column_inserts
=>
1
,
data_only
=>
1
,
data_only
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals_clean
=>
1
,
pg_dumpall_globals_clean
=>
1
,
section_data
=>
1
,
section_data
=>
1
,
section_post_data
=>
1
,
section_post_data
=>
1
,
},
},
},
},
'
COPY test_table
'
=>
{
'
COPY test_table
'
=>
{
create_order
=>
4
,
create_order
=>
4
,
create_sql
=>
create_sql
=>
'
INSERT INTO dump_test.test_table (col1)
'
'
INSERT INTO dump_test.test_table (col1)
'
.
'
SELECT generate_series FROM generate_series(1,9);
',
.
'
SELECT generate_series FROM generate_series(1,9);
',
regexp
=>
qr/^
regexp
=>
qr/^
\QCOPY test_table (col1) FROM stdin;\E
\QCOPY test_table (col1) FROM stdin;\E
...
@@ -798,18 +650,14 @@ my %tests = (
...
@@ -798,18 +650,14 @@ my %tests = (
only_dump_test_schema
=>
1
,
only_dump_test_schema
=>
1
,
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
section_data
=>
1
,
section_data
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
},
},
unlike
=>
{
unlike
=>
{
exclude_dump_test_schema
=>
1
,
exclude_dump_test_schema
=>
1
,
exclude_test_table
=>
1
,
exclude_test_table
=>
1
,
exclude_test_table_data
=>
1
,
exclude_test_table_data
=>
1
,
},
},
},
},
'
COPY fk_reference_test_table
'
=>
{
'
COPY fk_reference_test_table
'
=>
{
create_order
=>
22
,
create_order
=>
22
,
create_sql
=>
create_sql
=>
'
INSERT INTO dump_test.fk_reference_test_table (col1)
'
'
INSERT INTO dump_test.fk_reference_test_table (col1)
'
.
'
SELECT generate_series FROM generate_series(1,5);
',
.
'
SELECT generate_series FROM generate_series(1,5);
',
regexp
=>
qr/^
regexp
=>
qr/^
\QCOPY fk_reference_test_table (col1) FROM stdin;\E
\QCOPY fk_reference_test_table (col1) FROM stdin;\E
...
@@ -827,13 +675,10 @@ my %tests = (
...
@@ -827,13 +675,10 @@ my %tests = (
no_owner
=>
1
,
no_owner
=>
1
,
only_dump_test_schema
=>
1
,
only_dump_test_schema
=>
1
,
section_data
=>
1
,
section_data
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
},
},
unlike
=>
{
unlike
=>
{
exclude_dump_test_schema
=>
1
,
exclude_dump_test_schema
=>
1
,
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
},
},
},
},
'
COPY fk_reference_test_table second
'
=>
{
'
COPY fk_reference_test_table second
'
=>
{
regexp
=>
qr/^
regexp
=>
qr/^
\QCOPY test_table (col1) FROM stdin;\E
\QCOPY test_table (col1) FROM stdin;\E
...
@@ -841,19 +686,14 @@ my %tests = (
...
@@ -841,19 +686,14 @@ my %tests = (
\QCOPY fk_reference_test_table (col1) FROM stdin;\E
\QCOPY fk_reference_test_table (col1) FROM stdin;\E
\n(?:\d\n){5}\\\.\n
\n(?:\d\n){5}\\\.\n
/
xms
,
/
xms
,
like
=>
{
like
=>
{
data_only
=>
1
,
},
data_only
=>
1
,
},
unlike
=>
{
unlike
=>
{
exclude_dump_test_schema
=>
1
,
exclude_dump_test_schema
=>
1
,
exclude_test_table
=>
1
,
exclude_test_table
=>
1
,
exclude_test_table_data
=>
1
,
exclude_test_table_data
=>
1
,
},
},
},
},
'
COPY test_second_table
'
=>
{
'
COPY test_second_table
'
=>
{
create_order
=>
7
,
create_order
=>
7
,
create_sql
=>
create_sql
=>
'
INSERT INTO dump_test.test_second_table (col1, col2)
'
'
INSERT INTO dump_test.test_second_table (col1, col2)
'
.
'
SELECT generate_series, generate_series::text
'
.
'
SELECT generate_series, generate_series::text
'
.
'
FROM generate_series(1,9);
',
.
'
FROM generate_series(1,9);
',
regexp
=>
qr/^
regexp
=>
qr/^
...
@@ -872,13 +712,10 @@ my %tests = (
...
@@ -872,13 +712,10 @@ my %tests = (
no_owner
=>
1
,
no_owner
=>
1
,
only_dump_test_schema
=>
1
,
only_dump_test_schema
=>
1
,
section_data
=>
1
,
section_data
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
},
},
unlike
=>
{
unlike
=>
{
exclude_dump_test_schema
=>
1
,
exclude_dump_test_schema
=>
1
,
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
},
},
},
},
'
COPY test_third_table
'
=>
{
'
COPY test_third_table
'
=>
{
create_order
=>
12
,
create_order
=>
12
,
create_sql
=>
create_sql
=>
...
@@ -899,21 +736,16 @@ my %tests = (
...
@@ -899,21 +736,16 @@ my %tests = (
exclude_test_table_data
=>
1
,
exclude_test_table_data
=>
1
,
no_privs
=>
1
,
no_privs
=>
1
,
no_owner
=>
1
,
no_owner
=>
1
,
section_data
=>
1
,
section_data
=>
1
,
},
},
unlike
=>
{
unlike
=>
{
only_dump_test_schema
=>
1
,
only_dump_test_schema
=>
1
,
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
},
},
},
},
'
INSERT INTO test_table
'
=>
{
'
INSERT INTO test_table
'
=>
{
regexp
=>
qr/^
regexp
=>
qr/^
(?:INSERT\ INTO\ test_table\ \(col1\)\ VALUES\ \(\d\);\n){9}
(?:INSERT\ INTO\ test_table\ \(col1\)\ VALUES\ \(\d\);\n){9}
/
xm
,
/
xm
,
like
=>
{
like
=>
{
column_inserts
=>
1
,
},
column_inserts
=>
1
,
},
unlike
=>
{
unlike
=>
{
clean
=>
1
,
clean
=>
1
,
clean_if_exists
=>
1
,
clean_if_exists
=>
1
,
...
@@ -928,16 +760,12 @@ my %tests = (
...
@@ -928,16 +760,12 @@ my %tests = (
section_data
=>
1
,
section_data
=>
1
,
only_dump_test_schema
=>
1
,
only_dump_test_schema
=>
1
,
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
},
},
},
},
'
INSERT INTO test_second_table
'
=>
{
'
INSERT INTO test_second_table
'
=>
{
regexp
=>
qr/^
regexp
=>
qr/^
(?:INSERT\ INTO\ test_second_table\ \(col1,\ col2\)
(?:INSERT\ INTO\ test_second_table\ \(col1,\ col2\)
\ VALUES\ \(\d,\ '\d'\);\n){9}/
xm
,
\ VALUES\ \(\d,\ '\d'\);\n){9}/
xm
,
like
=>
{
like
=>
{
column_inserts
=>
1
,
},
column_inserts
=>
1
,
},
unlike
=>
{
unlike
=>
{
clean
=>
1
,
clean
=>
1
,
clean_if_exists
=>
1
,
clean_if_exists
=>
1
,
...
@@ -952,16 +780,12 @@ my %tests = (
...
@@ -952,16 +780,12 @@ my %tests = (
section_data
=>
1
,
section_data
=>
1
,
only_dump_test_schema
=>
1
,
only_dump_test_schema
=>
1
,
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
},
},
},
},
'
INSERT INTO test_third_table
'
=>
{
'
INSERT INTO test_third_table
'
=>
{
regexp
=>
qr/^
regexp
=>
qr/^
(?:INSERT\ INTO\ test_third_table\ \(col1\)
(?:INSERT\ INTO\ test_third_table\ \(col1\)
\ VALUES\ \(\d\);\n){9}/
xm
,
\ VALUES\ \(\d\);\n){9}/
xm
,
like
=>
{
like
=>
{
column_inserts
=>
1
,
},
column_inserts
=>
1
,
},
unlike
=>
{
unlike
=>
{
clean
=>
1
,
clean
=>
1
,
clean_if_exists
=>
1
,
clean_if_exists
=>
1
,
...
@@ -976,29 +800,24 @@ my %tests = (
...
@@ -976,29 +800,24 @@ my %tests = (
section_data
=>
1
,
section_data
=>
1
,
only_dump_test_schema
=>
1
,
only_dump_test_schema
=>
1
,
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
},
},
},
},
'
COPY ... commands
'
=>
{
# catch-all for COPY
'
COPY ... commands
'
=>
{
# catch-all for COPY
regexp
=>
qr/^COPY /
m,
regexp
=>
qr/^COPY /
m,
like
=> { },
# use more-specific options above
like
=> {},
# use more-specific options above
unlike
=>
{
unlike
=>
{
binary_upgrade
=>
1
,
binary_upgrade
=>
1
,
column_inserts
=>
1
,
column_inserts
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals_clean
=>
1
,
pg_dumpall_globals_clean
=>
1
,
schema_only
=>
1
,
schema_only
=>
1
,
section_post_data
=>
1
,
section_post_data
=>
1
,
},
},
},
},
'
CREATE ROLE dump_test
'
=>
{
'
CREATE ROLE dump_test
'
=>
{
create_order
=>
1
,
create_order
=>
1
,
create_sql
=>
'
CREATE ROLE dump_test;
',
create_sql
=>
'
CREATE ROLE dump_test;
',
regexp
=>
qr/^CREATE ROLE dump_test;/
m,
regexp
=>
qr/^CREATE ROLE dump_test;/
m,
like => {
like => {
pg_dumpall_globals => 1,
pg_dumpall_globals => 1,
pg_dumpall_globals_clean
=>
1
,
pg_dumpall_globals_clean
=>
1
,
},
},
unlike
=>
{
unlike
=>
{
binary_upgrade
=>
1
,
binary_upgrade
=>
1
,
clean
=>
1
,
clean
=>
1
,
...
@@ -1015,16 +834,12 @@ my %tests = (
...
@@ -1015,16 +834,12 @@ my %tests = (
schema_only
=>
1
,
schema_only
=>
1
,
section_pre_data
=>
1
,
section_pre_data
=>
1
,
section_post_data
=>
1
,
section_post_data
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
},
},
},
},
'
CREATE DATABASE postgres
'
=>
{
'
CREATE DATABASE postgres
'
=>
{
regexp
=>
qr/^
regexp
=>
qr/^
\QCREATE DATABASE postgres WITH TEMPLATE = template0 \E
\QCREATE DATABASE postgres WITH TEMPLATE = template0 \E
.*;/
xm
,
.*;/
xm
,
like
=>
{
like
=>
{
createdb
=>
1
,
},
createdb
=>
1
,
},
unlike
=>
{
unlike
=>
{
binary_upgrade
=>
1
,
binary_upgrade
=>
1
,
clean
=>
1
,
clean
=>
1
,
...
@@ -1042,9 +857,7 @@ my %tests = (
...
@@ -1042,9 +857,7 @@ my %tests = (
schema_only
=>
1
,
schema_only
=>
1
,
section_pre_data
=>
1
,
section_pre_data
=>
1
,
section_post_data
=>
1
,
section_post_data
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
},
},
},
},
'
CREATE EXTENSION ... plpgsql
'
=>
{
'
CREATE EXTENSION ... plpgsql
'
=>
{
regexp
=>
qr/^
regexp
=>
qr/^
\QCREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;\E
\QCREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;\E
...
@@ -1060,8 +873,7 @@ my %tests = (
...
@@ -1060,8 +873,7 @@ 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
,
only_dump_test_schema
=>
1
,
only_dump_test_schema
=>
1
,
...
@@ -1069,9 +881,7 @@ my %tests = (
...
@@ -1069,9 +881,7 @@ my %tests = (
pg_dumpall_globals
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals_clean
=>
1
,
pg_dumpall_globals_clean
=>
1
,
section_post_data
=>
1
,
section_post_data
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
},
},
},
},
'
CREATE AGGREGATE dump_test.newavg
'
=>
{
'
CREATE AGGREGATE dump_test.newavg
'
=>
{
create_order
=>
25
,
create_order
=>
25
,
create_sql
=>
'
CREATE AGGREGATE dump_test.newavg (
create_sql
=>
'
CREATE AGGREGATE dump_test.newavg (
...
@@ -1101,16 +911,13 @@ my %tests = (
...
@@ -1101,16 +911,13 @@ my %tests = (
only_dump_test_schema
=>
1
,
only_dump_test_schema
=>
1
,
schema_only
=>
1
,
schema_only
=>
1
,
section_pre_data
=>
1
,
section_pre_data
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
},
},
unlike
=>
{
unlike
=>
{
exclude_dump_test_schema
=>
1
,
exclude_dump_test_schema
=>
1
,
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals_clean
=>
1
,
pg_dumpall_globals_clean
=>
1
,
section_post_data
=>
1
,
section_post_data
=>
1
,
},
},
},
},
'
CREATE DOMAIN dump_test.us_postal_code
'
=>
{
'
CREATE DOMAIN dump_test.us_postal_code
'
=>
{
create_order
=>
29
,
create_order
=>
29
,
create_sql
=>
'
CREATE DOMAIN dump_test.us_postal_code AS TEXT
create_sql
=>
'
CREATE DOMAIN dump_test.us_postal_code AS TEXT
...
@@ -1137,16 +944,13 @@ my %tests = (
...
@@ -1137,16 +944,13 @@ my %tests = (
only_dump_test_schema
=>
1
,
only_dump_test_schema
=>
1
,
schema_only
=>
1
,
schema_only
=>
1
,
section_pre_data
=>
1
,
section_pre_data
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
},
},
unlike
=>
{
unlike
=>
{
exclude_dump_test_schema
=>
1
,
exclude_dump_test_schema
=>
1
,
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals_clean
=>
1
,
pg_dumpall_globals_clean
=>
1
,
section_post_data
=>
1
,
section_post_data
=>
1
,
},
},
},
},
'
CREATE FUNCTION dump_test.pltestlang_call_handler
'
=>
{
'
CREATE FUNCTION dump_test.pltestlang_call_handler
'
=>
{
create_order
=>
17
,
create_order
=>
17
,
create_sql
=>
'
CREATE FUNCTION dump_test.pltestlang_call_handler()
create_sql
=>
'
CREATE FUNCTION dump_test.pltestlang_call_handler()
...
@@ -1172,16 +976,13 @@ my %tests = (
...
@@ -1172,16 +976,13 @@ my %tests = (
only_dump_test_schema => 1,
only_dump_test_schema => 1,
schema_only => 1,
schema_only => 1,
section_pre_data => 1,
section_pre_data => 1,
test_schema_plus_blobs => 1,
test_schema_plus_blobs => 1, },
},
unlike => {
unlike => {
exclude_dump_test_schema => 1,
exclude_dump_test_schema => 1,
only_dump_test_table => 1,
only_dump_test_table => 1,
pg_dumpall_globals => 1,
pg_dumpall_globals => 1,
pg_dumpall_globals_clean => 1,
pg_dumpall_globals_clean => 1,
section_post_data => 1,
section_post_data => 1, }, },
},
},
'
CREATE
FUNCTION
dump_test
.
trigger_func
'
=> {
'
CREATE
FUNCTION
dump_test
.
trigger_func
'
=> {
create_order => 30,
create_order => 30,
create_sql =>
'
CREATE
FUNCTION
dump_test
.
trigger_func
()
create_sql =>
'
CREATE
FUNCTION
dump_test
.
trigger_func
()
...
@@ -1206,16 +1007,13 @@ my %tests = (
...
@@ -1206,16 +1007,13 @@ my %tests = (
only_dump_test_schema => 1,
only_dump_test_schema => 1,
schema_only => 1,
schema_only => 1,
section_pre_data => 1,
section_pre_data => 1,
test_schema_plus_blobs => 1,
test_schema_plus_blobs => 1, },
},
unlike => {
unlike => {
exclude_dump_test_schema => 1,
exclude_dump_test_schema => 1,
only_dump_test_table => 1,
only_dump_test_table => 1,
pg_dumpall_globals => 1,
pg_dumpall_globals => 1,
pg_dumpall_globals_clean => 1,
pg_dumpall_globals_clean => 1,
section_post_data => 1,
section_post_data => 1, }, },
},
},
'
CREATE
FUNCTION
dump_test
.
event_trigger_func
'
=> {
'
CREATE
FUNCTION
dump_test
.
event_trigger_func
'
=> {
create_order => 32,
create_order => 32,
create_sql =>
'
CREATE
FUNCTION
dump_test
.
event_trigger_func
()
create_sql =>
'
CREATE
FUNCTION
dump_test
.
event_trigger_func
()
...
@@ -1240,16 +1038,13 @@ my %tests = (
...
@@ -1240,16 +1038,13 @@ my %tests = (
only_dump_test_schema => 1,
only_dump_test_schema => 1,
schema_only => 1,
schema_only => 1,
section_pre_data => 1,
section_pre_data => 1,
test_schema_plus_blobs => 1,
test_schema_plus_blobs => 1, },
},
unlike => {
unlike => {
exclude_dump_test_schema => 1,
exclude_dump_test_schema => 1,
only_dump_test_table => 1,
only_dump_test_table => 1,
pg_dumpall_globals => 1,
pg_dumpall_globals => 1,
pg_dumpall_globals_clean => 1,
pg_dumpall_globals_clean => 1,
section_post_data => 1,
section_post_data => 1, }, },
},
},
'
CREATE
EVENT
TRIGGER
test_event_trigger
'
=> {
'
CREATE
EVENT
TRIGGER
test_event_trigger
'
=> {
create_order => 33,
create_order => 33,
create_sql =>
'
CREATE
EVENT
TRIGGER
test_event_trigger
create_sql =>
'
CREATE
EVENT
TRIGGER
test_event_trigger
...
@@ -1272,17 +1067,14 @@ my %tests = (
...
@@ -1272,17 +1067,14 @@ my %tests = (
no_privs => 1,
no_privs => 1,
no_owner => 1,
no_owner => 1,
schema_only => 1,
schema_only => 1,
section_post_data => 1,
section_post_data => 1, },
},
unlike => {
unlike => {
section_pre_data => 1,
section_pre_data => 1,
only_dump_test_schema => 1,
only_dump_test_schema => 1,
only_dump_test_table => 1,
only_dump_test_table => 1,
pg_dumpall_globals => 1,
pg_dumpall_globals => 1,
pg_dumpall_globals_clean => 1,
pg_dumpall_globals_clean => 1,
test_schema_plus_blobs => 1,
test_schema_plus_blobs => 1, }, },
},
},
'
CREATE
TRIGGER
test_trigger
'
=> {
'
CREATE
TRIGGER
test_trigger
'
=> {
create_order => 31,
create_order => 31,
create_sql =>
'
CREATE
TRIGGER
test_trigger
create_sql =>
'
CREATE
TRIGGER
test_trigger
...
@@ -1307,16 +1099,13 @@ my %tests = (
...
@@ -1307,16 +1099,13 @@ my %tests = (
only_dump_test_table => 1,
only_dump_test_table => 1,
schema_only => 1,
schema_only => 1,
section_post_data => 1,
section_post_data => 1,
test_schema_plus_blobs => 1,
test_schema_plus_blobs => 1, },
},
unlike => {
unlike => {
section_pre_data => 1,
section_pre_data => 1,
exclude_dump_test_schema => 1,
exclude_dump_test_schema => 1,
exclude_test_table => 1,
exclude_test_table => 1,
pg_dumpall_globals => 1,
pg_dumpall_globals => 1,
pg_dumpall_globals_clean => 1,
pg_dumpall_globals_clean => 1, }, },
},
},
'
CREATE
TYPE
dump_test
.
planets
AS
ENUM
'
=> {
'
CREATE
TYPE
dump_test
.
planets
AS
ENUM
'
=> {
create_order => 37,
create_order => 37,
create_sql =>
'
CREATE
TYPE
dump_test
.
planets
create_sql =>
'
CREATE
TYPE
dump_test
.
planets
...
@@ -1339,16 +1128,13 @@ my %tests = (
...
@@ -1339,16 +1128,13 @@ my %tests = (
only_dump_test_schema
=>
1
,
only_dump_test_schema
=>
1
,
schema_only
=>
1
,
schema_only
=>
1
,
section_pre_data
=>
1
,
section_pre_data
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
},
},
unlike
=>
{
unlike
=>
{
exclude_dump_test_schema
=>
1
,
exclude_dump_test_schema
=>
1
,
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals_clean
=>
1
,
pg_dumpall_globals_clean
=>
1
,
section_post_data
=>
1
,
section_post_data
=>
1
,
},
},
},
},
'
CREATE TYPE dump_test.planets AS ENUM pg_upgrade
'
=>
{
'
CREATE TYPE dump_test.planets AS ENUM pg_upgrade
'
=>
{
regexp
=>
qr/^
regexp
=>
qr/^
\QCREATE TYPE planets AS ENUM (\E
\QCREATE TYPE planets AS ENUM (\E
...
@@ -1359,9 +1145,7 @@ my %tests = (
...
@@ -1359,9 +1145,7 @@ my %tests = (
\n.*^
\n.*^
\QALTER TYPE dump_test.planets ADD VALUE 'mars';\E
\QALTER TYPE dump_test.planets ADD VALUE 'mars';\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
,
...
@@ -1379,9 +1163,7 @@ my %tests = (
...
@@ -1379,9 +1163,7 @@ my %tests = (
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals_clean
=>
1
,
pg_dumpall_globals_clean
=>
1
,
section_post_data
=>
1
,
section_post_data
=>
1
,
},
},
},
},
'
CREATE TYPE dump_test.textrange AS RANGE
'
=>
{
'
CREATE TYPE dump_test.textrange AS RANGE
'
=>
{
create_order
=>
38
,
create_order
=>
38
,
create_sql
=>
'
CREATE TYPE dump_test.textrange
create_sql
=>
'
CREATE TYPE dump_test.textrange
...
@@ -1403,16 +1185,13 @@ my %tests = (
...
@@ -1403,16 +1185,13 @@ my %tests = (
only_dump_test_schema
=>
1
,
only_dump_test_schema
=>
1
,
schema_only
=>
1
,
schema_only
=>
1
,
section_pre_data
=>
1
,
section_pre_data
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
},
},
unlike
=>
{
unlike
=>
{
exclude_dump_test_schema
=>
1
,
exclude_dump_test_schema
=>
1
,
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals_clean
=>
1
,
pg_dumpall_globals_clean
=>
1
,
section_post_data
=>
1
,
section_post_data
=>
1
,
},
},
},
},
'
CREATE TYPE dump_test.int42
'
=>
{
'
CREATE TYPE dump_test.int42
'
=>
{
create_order
=>
39
,
create_order
=>
39
,
create_sql
=>
'
CREATE TYPE dump_test.int42;
',
create_sql
=>
'
CREATE TYPE dump_test.int42;
',
...
@@ -1429,16 +1208,13 @@ my %tests = (
...
@@ -1429,16 +1208,13 @@ my %tests = (
only_dump_test_schema
=>
1
,
only_dump_test_schema
=>
1
,
schema_only
=>
1
,
schema_only
=>
1
,
section_pre_data
=>
1
,
section_pre_data
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
},
},
unlike
=>
{
unlike
=>
{
exclude_dump_test_schema
=>
1
,
exclude_dump_test_schema
=>
1
,
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals_clean
=>
1
,
pg_dumpall_globals_clean
=>
1
,
section_post_data
=>
1
,
section_post_data
=>
1
,
},
},
},
},
'
CREATE FUNCTION dump_test.int42_in
'
=>
{
'
CREATE FUNCTION dump_test.int42_in
'
=>
{
create_order
=>
40
,
create_order
=>
40
,
create_sql
=>
'
CREATE FUNCTION dump_test.int42_in(cstring)
create_sql
=>
'
CREATE FUNCTION dump_test.int42_in(cstring)
...
@@ -1462,16 +1238,13 @@ my %tests = (
...
@@ -1462,16 +1238,13 @@ my %tests = (
only_dump_test_schema
=>
1
,
only_dump_test_schema
=>
1
,
schema_only
=>
1
,
schema_only
=>
1
,
section_pre_data
=>
1
,
section_pre_data
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
},
},
unlike
=>
{
unlike
=>
{
exclude_dump_test_schema
=>
1
,
exclude_dump_test_schema
=>
1
,
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals_clean
=>
1
,
pg_dumpall_globals_clean
=>
1
,
section_post_data
=>
1
,
section_post_data
=>
1
,
},
},
},
},
'
CREATE FUNCTION dump_test.int42_out
'
=>
{
'
CREATE FUNCTION dump_test.int42_out
'
=>
{
create_order
=>
41
,
create_order
=>
41
,
create_sql
=>
'
CREATE FUNCTION dump_test.int42_out(dump_test.int42)
create_sql
=>
'
CREATE FUNCTION dump_test.int42_out(dump_test.int42)
...
@@ -1495,16 +1268,13 @@ my %tests = (
...
@@ -1495,16 +1268,13 @@ my %tests = (
only_dump_test_schema
=>
1
,
only_dump_test_schema
=>
1
,
schema_only
=>
1
,
schema_only
=>
1
,
section_pre_data
=>
1
,
section_pre_data
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
},
},
unlike
=>
{
unlike
=>
{
exclude_dump_test_schema
=>
1
,
exclude_dump_test_schema
=>
1
,
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals_clean
=>
1
,
pg_dumpall_globals_clean
=>
1
,
section_post_data
=>
1
,
section_post_data
=>
1
,
},
},
},
},
'
CREATE TYPE dump_test.int42 populated
'
=>
{
'
CREATE TYPE dump_test.int42 populated
'
=>
{
create_order
=>
42
,
create_order
=>
42
,
create_sql
=>
'
CREATE TYPE dump_test.int42 (
create_sql
=>
'
CREATE TYPE dump_test.int42 (
...
@@ -1536,16 +1306,13 @@ my %tests = (
...
@@ -1536,16 +1306,13 @@ my %tests = (
only_dump_test_schema
=>
1
,
only_dump_test_schema
=>
1
,
schema_only
=>
1
,
schema_only
=>
1
,
section_pre_data
=>
1
,
section_pre_data
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
},
},
unlike
=>
{
unlike
=>
{
exclude_dump_test_schema
=>
1
,
exclude_dump_test_schema
=>
1
,
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals_clean
=>
1
,
pg_dumpall_globals_clean
=>
1
,
section_post_data
=>
1
,
section_post_data
=>
1
,
},
},
},
},
'
CREATE TYPE dump_test.composite
'
=>
{
'
CREATE TYPE dump_test.composite
'
=>
{
create_order
=>
43
,
create_order
=>
43
,
create_sql
=>
'
CREATE TYPE dump_test.composite AS (
create_sql
=>
'
CREATE TYPE dump_test.composite AS (
...
@@ -1570,16 +1337,13 @@ my %tests = (
...
@@ -1570,16 +1337,13 @@ my %tests = (
only_dump_test_schema
=>
1
,
only_dump_test_schema
=>
1
,
schema_only
=>
1
,
schema_only
=>
1
,
section_pre_data
=>
1
,
section_pre_data
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
},
},
unlike
=>
{
unlike
=>
{
exclude_dump_test_schema
=>
1
,
exclude_dump_test_schema
=>
1
,
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals_clean
=>
1
,
pg_dumpall_globals_clean
=>
1
,
section_post_data
=>
1
,
section_post_data
=>
1
,
},
},
},
},
'
CREATE FOREIGN DATA WRAPPER dummy
'
=>
{
'
CREATE FOREIGN DATA WRAPPER dummy
'
=>
{
create_order
=>
35
,
create_order
=>
35
,
create_sql
=>
'
CREATE FOREIGN DATA WRAPPER dummy;
',
create_sql
=>
'
CREATE FOREIGN DATA WRAPPER dummy;
',
...
@@ -1596,17 +1360,14 @@ my %tests = (
...
@@ -1596,17 +1360,14 @@ 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
=>
{
only_dump_test_schema
=>
1
,
only_dump_test_schema
=>
1
,
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals_clean
=>
1
,
pg_dumpall_globals_clean
=>
1
,
section_post_data
=>
1
,
section_post_data
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
},
},
},
},
'
CREATE SERVER s1 FOREIGN DATA WRAPPER dummy
'
=>
{
'
CREATE SERVER s1 FOREIGN DATA WRAPPER dummy
'
=>
{
create_order
=>
36
,
create_order
=>
36
,
create_sql
=>
'
CREATE SERVER s1 FOREIGN DATA WRAPPER dummy;
',
create_sql
=>
'
CREATE SERVER s1 FOREIGN DATA WRAPPER dummy;
',
...
@@ -1623,19 +1384,16 @@ my %tests = (
...
@@ -1623,19 +1384,16 @@ 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
=>
{
only_dump_test_schema
=>
1
,
only_dump_test_schema
=>
1
,
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals_clean
=>
1
,
pg_dumpall_globals_clean
=>
1
,
section_post_data
=>
1
,
section_post_data
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
},
},
},
},
#######################################
#######################################
# Currently broken.
# Currently broken.
#######################################
#######################################
#
#
# 'CREATE TRANSFORM FOR int' => {
# 'CREATE TRANSFORM FOR int' => {
...
@@ -1683,8 +1441,7 @@ my %tests = (
...
@@ -1683,8 +1441,7 @@ 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
=>
{
exclude_dump_test_schema
=>
1
,
exclude_dump_test_schema
=>
1
,
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
...
@@ -1692,9 +1449,7 @@ my %tests = (
...
@@ -1692,9 +1449,7 @@ my %tests = (
pg_dumpall_globals_clean
=>
1
,
pg_dumpall_globals_clean
=>
1
,
section_post_data
=>
1
,
section_post_data
=>
1
,
only_dump_test_schema
=>
1
,
only_dump_test_schema
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
},
},
},
},
'
CREATE MATERIALIZED VIEW matview
'
=>
{
'
CREATE MATERIALIZED VIEW matview
'
=>
{
create_order
=>
20
,
create_order
=>
20
,
create_sql
=>
'
CREATE MATERIALIZED VIEW dump_test.matview (col1) AS
create_sql
=>
'
CREATE MATERIALIZED VIEW dump_test.matview (col1) AS
...
@@ -1718,16 +1473,13 @@ my %tests = (
...
@@ -1718,16 +1473,13 @@ my %tests = (
only_dump_test_schema
=>
1
,
only_dump_test_schema
=>
1
,
schema_only
=>
1
,
schema_only
=>
1
,
section_pre_data
=>
1
,
section_pre_data
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
},
},
unlike
=>
{
unlike
=>
{
exclude_dump_test_schema
=>
1
,
exclude_dump_test_schema
=>
1
,
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals_clean
=>
1
,
pg_dumpall_globals_clean
=>
1
,
section_post_data
=>
1
,
section_post_data
=>
1
,
},
},
},
},
'
CREATE MATERIALIZED VIEW matview_second
'
=>
{
'
CREATE MATERIALIZED VIEW matview_second
'
=>
{
create_order
=>
21
,
create_order
=>
21
,
create_sql
=>
'
CREATE MATERIALIZED VIEW
create_sql
=>
'
CREATE MATERIALIZED VIEW
...
@@ -1752,16 +1504,13 @@ my %tests = (
...
@@ -1752,16 +1504,13 @@ my %tests = (
only_dump_test_schema
=>
1
,
only_dump_test_schema
=>
1
,
schema_only
=>
1
,
schema_only
=>
1
,
section_pre_data
=>
1
,
section_pre_data
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
},
},
unlike
=>
{
unlike
=>
{
exclude_dump_test_schema
=>
1
,
exclude_dump_test_schema
=>
1
,
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals_clean
=>
1
,
pg_dumpall_globals_clean
=>
1
,
section_post_data
=>
1
,
section_post_data
=>
1
,
},
},
},
},
'
CREATE POLICY p1 ON test_table
'
=>
{
'
CREATE POLICY p1 ON test_table
'
=>
{
create_order
=>
22
,
create_order
=>
22
,
create_sql
=>
'
CREATE POLICY p1 ON dump_test.test_table
create_sql
=>
'
CREATE POLICY p1 ON dump_test.test_table
...
@@ -1784,16 +1533,13 @@ my %tests = (
...
@@ -1784,16 +1533,13 @@ my %tests = (
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
schema_only
=>
1
,
schema_only
=>
1
,
section_post_data
=>
1
,
section_post_data
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
},
},
unlike
=>
{
unlike
=>
{
section_pre_data
=>
1
,
section_pre_data
=>
1
,
exclude_dump_test_schema
=>
1
,
exclude_dump_test_schema
=>
1
,
exclude_test_table
=>
1
,
exclude_test_table
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals_clean
=>
1
,
pg_dumpall_globals_clean
=>
1
,
},
},
},
},
'
CREATE POLICY p2 ON test_table FOR SELECT
'
=>
{
'
CREATE POLICY p2 ON test_table FOR SELECT
'
=>
{
create_order
=>
24
,
create_order
=>
24
,
create_sql
=>
'
CREATE POLICY p2 ON dump_test.test_table
create_sql
=>
'
CREATE POLICY p2 ON dump_test.test_table
...
@@ -1815,16 +1561,13 @@ my %tests = (
...
@@ -1815,16 +1561,13 @@ my %tests = (
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
schema_only
=>
1
,
schema_only
=>
1
,
section_post_data
=>
1
,
section_post_data
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
},
},
unlike
=>
{
unlike
=>
{
section_pre_data
=>
1
,
section_pre_data
=>
1
,
exclude_dump_test_schema
=>
1
,
exclude_dump_test_schema
=>
1
,
exclude_test_table
=>
1
,
exclude_test_table
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals_clean
=>
1
,
pg_dumpall_globals_clean
=>
1
,
},
},
},
},
'
CREATE POLICY p3 ON test_table FOR INSERT
'
=>
{
'
CREATE POLICY p3 ON test_table FOR INSERT
'
=>
{
create_order
=>
25
,
create_order
=>
25
,
create_sql
=>
'
CREATE POLICY p3 ON dump_test.test_table
create_sql
=>
'
CREATE POLICY p3 ON dump_test.test_table
...
@@ -1846,16 +1589,13 @@ my %tests = (
...
@@ -1846,16 +1589,13 @@ my %tests = (
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
schema_only
=>
1
,
schema_only
=>
1
,
section_post_data
=>
1
,
section_post_data
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
},
},
unlike
=>
{
unlike
=>
{
section_pre_data
=>
1
,
section_pre_data
=>
1
,
exclude_dump_test_schema
=>
1
,
exclude_dump_test_schema
=>
1
,
exclude_test_table
=>
1
,
exclude_test_table
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals_clean
=>
1
,
pg_dumpall_globals_clean
=>
1
,
},
},
},
},
'
CREATE POLICY p4 ON test_table FOR UPDATE
'
=>
{
'
CREATE POLICY p4 ON test_table FOR UPDATE
'
=>
{
create_order
=>
26
,
create_order
=>
26
,
create_sql
=>
'
CREATE POLICY p4 ON dump_test.test_table FOR UPDATE
create_sql
=>
'
CREATE POLICY p4 ON dump_test.test_table FOR UPDATE
...
@@ -1877,16 +1617,13 @@ my %tests = (
...
@@ -1877,16 +1617,13 @@ my %tests = (
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
schema_only
=>
1
,
schema_only
=>
1
,
section_post_data
=>
1
,
section_post_data
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
},
},
unlike
=>
{
unlike
=>
{
section_pre_data
=>
1
,
section_pre_data
=>
1
,
exclude_dump_test_schema
=>
1
,
exclude_dump_test_schema
=>
1
,
exclude_test_table
=>
1
,
exclude_test_table
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals_clean
=>
1
,
pg_dumpall_globals_clean
=>
1
,
},
},
},
},
'
CREATE POLICY p5 ON test_table FOR DELETE
'
=>
{
'
CREATE POLICY p5 ON test_table FOR DELETE
'
=>
{
create_order
=>
27
,
create_order
=>
27
,
create_sql
=>
'
CREATE POLICY p5 ON dump_test.test_table
create_sql
=>
'
CREATE POLICY p5 ON dump_test.test_table
...
@@ -1908,16 +1645,13 @@ my %tests = (
...
@@ -1908,16 +1645,13 @@ my %tests = (
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
schema_only
=>
1
,
schema_only
=>
1
,
section_post_data
=>
1
,
section_post_data
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
},
},
unlike
=>
{
unlike
=>
{
section_pre_data
=>
1
,
section_pre_data
=>
1
,
exclude_dump_test_schema
=>
1
,
exclude_dump_test_schema
=>
1
,
exclude_test_table
=>
1
,
exclude_test_table
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals_clean
=>
1
,
pg_dumpall_globals_clean
=>
1
,
},
},
},
},
'
CREATE SCHEMA dump_test
'
=>
{
'
CREATE SCHEMA dump_test
'
=>
{
create_order
=>
2
,
create_order
=>
2
,
create_sql
=>
'
CREATE SCHEMA dump_test;
',
create_sql
=>
'
CREATE SCHEMA dump_test;
',
...
@@ -1935,16 +1669,13 @@ my %tests = (
...
@@ -1935,16 +1669,13 @@ my %tests = (
only_dump_test_schema
=>
1
,
only_dump_test_schema
=>
1
,
schema_only
=>
1
,
schema_only
=>
1
,
section_pre_data
=>
1
,
section_pre_data
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
},
},
unlike
=>
{
unlike
=>
{
exclude_dump_test_schema
=>
1
,
exclude_dump_test_schema
=>
1
,
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals_clean
=>
1
,
pg_dumpall_globals_clean
=>
1
,
section_post_data
=>
1
,
section_post_data
=>
1
,
},
},
},
},
'
CREATE SCHEMA dump_test_second_schema
'
=>
{
'
CREATE SCHEMA dump_test_second_schema
'
=>
{
create_order
=>
9
,
create_order
=>
9
,
create_sql
=>
'
CREATE SCHEMA dump_test_second_schema;
',
create_sql
=>
'
CREATE SCHEMA dump_test_second_schema;
',
...
@@ -1961,17 +1692,14 @@ my %tests = (
...
@@ -1961,17 +1692,14 @@ 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
=>
{
only_dump_test_schema
=>
1
,
only_dump_test_schema
=>
1
,
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals_clean
=>
1
,
pg_dumpall_globals_clean
=>
1
,
section_post_data
=>
1
,
section_post_data
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
},
},
},
},
'
CREATE TABLE test_table
'
=>
{
'
CREATE TABLE test_table
'
=>
{
create_order
=>
3
,
create_order
=>
3
,
create_sql
=>
'
CREATE TABLE dump_test.test_table (
create_sql
=>
'
CREATE TABLE dump_test.test_table (
...
@@ -1997,16 +1725,13 @@ my %tests = (
...
@@ -1997,16 +1725,13 @@ my %tests = (
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
schema_only
=>
1
,
schema_only
=>
1
,
section_pre_data
=>
1
,
section_pre_data
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
},
},
unlike
=>
{
unlike
=>
{
exclude_dump_test_schema
=>
1
,
exclude_dump_test_schema
=>
1
,
exclude_test_table
=>
1
,
exclude_test_table
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals_clean
=>
1
,
pg_dumpall_globals_clean
=>
1
,
section_post_data
=>
1
,
section_post_data
=>
1
,
},
},
},
},
'
CREATE TABLE fk_reference_test_table
'
=>
{
'
CREATE TABLE fk_reference_test_table
'
=>
{
create_order
=>
21
,
create_order
=>
21
,
create_sql
=>
'
CREATE TABLE dump_test.fk_reference_test_table (
create_sql
=>
'
CREATE TABLE dump_test.fk_reference_test_table (
...
@@ -2030,16 +1755,13 @@ my %tests = (
...
@@ -2030,16 +1755,13 @@ my %tests = (
only_dump_test_schema
=>
1
,
only_dump_test_schema
=>
1
,
schema_only
=>
1
,
schema_only
=>
1
,
section_pre_data
=>
1
,
section_pre_data
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
},
},
unlike
=>
{
unlike
=>
{
exclude_dump_test_schema
=>
1
,
exclude_dump_test_schema
=>
1
,
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals_clean
=>
1
,
pg_dumpall_globals_clean
=>
1
,
section_post_data
=>
1
,
section_post_data
=>
1
,
},
},
},
},
'
CREATE TABLE test_second_table
'
=>
{
'
CREATE TABLE test_second_table
'
=>
{
create_order
=>
6
,
create_order
=>
6
,
create_sql
=>
'
CREATE TABLE dump_test.test_second_table (
create_sql
=>
'
CREATE TABLE dump_test.test_second_table (
...
@@ -2065,16 +1787,13 @@ my %tests = (
...
@@ -2065,16 +1787,13 @@ my %tests = (
only_dump_test_schema
=>
1
,
only_dump_test_schema
=>
1
,
schema_only
=>
1
,
schema_only
=>
1
,
section_pre_data
=>
1
,
section_pre_data
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
},
},
unlike
=>
{
unlike
=>
{
exclude_dump_test_schema
=>
1
,
exclude_dump_test_schema
=>
1
,
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals_clean
=>
1
,
pg_dumpall_globals_clean
=>
1
,
section_post_data
=>
1
,
section_post_data
=>
1
,
},
},
},
},
'
CREATE TABLE test_third_table
'
=>
{
'
CREATE TABLE test_third_table
'
=>
{
create_order
=>
11
,
create_order
=>
11
,
create_sql
=>
'
CREATE TABLE dump_test_second_schema.test_third_table (
create_sql
=>
'
CREATE TABLE dump_test_second_schema.test_third_table (
...
@@ -2097,17 +1816,14 @@ my %tests = (
...
@@ -2097,17 +1816,14 @@ 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
=>
{
only_dump_test_schema
=>
1
,
only_dump_test_schema
=>
1
,
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals_clean
=>
1
,
pg_dumpall_globals_clean
=>
1
,
section_post_data
=>
1
,
section_post_data
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
},
},
},
},
'
CREATE SEQUENCE test_table_col1_seq
'
=>
{
'
CREATE SEQUENCE test_table_col1_seq
'
=>
{
regexp
=>
qr/^
regexp
=>
qr/^
\QCREATE SEQUENCE test_table_col1_seq\E
\QCREATE SEQUENCE test_table_col1_seq\E
...
@@ -2131,15 +1847,12 @@ my %tests = (
...
@@ -2131,15 +1847,12 @@ my %tests = (
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
schema_only
=>
1
,
schema_only
=>
1
,
section_pre_data
=>
1
,
section_pre_data
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
},
},
unlike
=>
{
unlike
=>
{
exclude_dump_test_schema
=>
1
,
exclude_dump_test_schema
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals_clean
=>
1
,
pg_dumpall_globals_clean
=>
1
,
section_post_data
=>
1
,
section_post_data
=>
1
,
},
},
},
},
'
CREATE SEQUENCE test_third_table_col1_seq
'
=>
{
'
CREATE SEQUENCE test_third_table_col1_seq
'
=>
{
regexp
=>
qr/^
regexp
=>
qr/^
\QCREATE SEQUENCE test_third_table_col1_seq\E
\QCREATE SEQUENCE test_third_table_col1_seq\E
...
@@ -2161,17 +1874,14 @@ my %tests = (
...
@@ -2161,17 +1874,14 @@ 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
=>
{
only_dump_test_schema
=>
1
,
only_dump_test_schema
=>
1
,
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals_clean
=>
1
,
pg_dumpall_globals_clean
=>
1
,
section_post_data
=>
1
,
section_post_data
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
},
},
},
},
'
CREATE UNIQUE INDEX test_third_table_idx ON test_third_table
'
=>
{
'
CREATE UNIQUE INDEX test_third_table_idx ON test_third_table
'
=>
{
create_order
=>
13
,
create_order
=>
13
,
create_sql
=>
'
CREATE UNIQUE INDEX test_third_table_idx
create_sql
=>
'
CREATE UNIQUE INDEX test_third_table_idx
...
@@ -2192,209 +1902,112 @@ my %tests = (
...
@@ -2192,209 +1902,112 @@ my %tests = (
no_privs
=>
1
,
no_privs
=>
1
,
no_owner
=>
1
,
no_owner
=>
1
,
schema_only
=>
1
,
schema_only
=>
1
,
section_post_data
=>
1
,
section_post_data
=>
1
,
},
},
unlike
=>
{
unlike
=>
{
only_dump_test_schema
=>
1
,
only_dump_test_schema
=>
1
,
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals_clean
=>
1
,
pg_dumpall_globals_clean
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
},
},
},
},
'
CREATE ... commands
'
=>
{
# catch-all for CREATE
'
CREATE ... commands
'
=>
{
# catch-all for CREATE
regexp
=>
qr/^CREATE /
m,
regexp
=>
qr/^CREATE /
m,
like
=> { },
# use more-specific options above
like
=> {},
# use more-specific options above
unlike
=>
{
unlike
=>
{
column_inserts
=>
1
,
column_inserts
=>
1
,
data_only
=>
1
,
data_only
=>
1
,
section_data
=>
1
,
section_data
=>
1
,
},
},
},
},
'
DROP EXTENSION plpgsql
'
=>
{
'
DROP EXTENSION plpgsql
'
=>
{
regexp
=>
qr/^DROP EXTENSION plpgsql;/
m,
regexp
=>
qr/^DROP EXTENSION plpgsql;/
m,
like => {
like => { clean => 1,
},
clean => 1,
unlike
=>
{
clean_if_exists
=>
1
,
},
},
},
unlike
=>
{
clean_if_exists
=>
1
,
},
},
'
DROP FUNCTION dump_test.pltestlang_call_handler()
'
=>
{
'
DROP FUNCTION dump_test.pltestlang_call_handler()
'
=>
{
regexp
=>
qr/^DROP FUNCTION dump_test\.pltestlang_call_handler\(\);/
m,
regexp
=>
qr/^DROP FUNCTION dump_test\.pltestlang_call_handler\(\);/
m,
like => {
like => { clean => 1,
},
clean => 1,
unlike
=>
{
clean_if_exists
=>
1
,
},
},
},
unlike
=>
{
clean_if_exists
=>
1
,
},
},
'
DROP LANGUAGE pltestlang
'
=>
{
'
DROP LANGUAGE pltestlang
'
=>
{
regexp
=>
qr/^DROP PROCEDURAL LANGUAGE pltestlang;/
m,
regexp
=>
qr/^DROP PROCEDURAL LANGUAGE pltestlang;/
m,
like => {
like => { clean => 1,
},
clean => 1,
unlike
=>
{
clean_if_exists
=>
1
,
},
},
},
unlike
=>
{
clean_if_exists
=>
1
,
},
},
'
DROP SCHEMA dump_test
'
=>
{
'
DROP SCHEMA dump_test
'
=>
{
regexp
=>
qr/^DROP SCHEMA dump_test;/
m,
regexp
=>
qr/^DROP SCHEMA dump_test;/
m,
like => {
like => { clean => 1,
},
clean => 1,
unlike
=>
{
clean_if_exists
=>
1
,
},
},
},
unlike
=>
{
clean_if_exists
=>
1
,
},
},
'
DROP SCHEMA dump_test_second_schema
'
=>
{
'
DROP SCHEMA dump_test_second_schema
'
=>
{
regexp
=>
qr/^DROP SCHEMA dump_test_second_schema;/
m,
regexp
=>
qr/^DROP SCHEMA dump_test_second_schema;/
m,
like => {
like => { clean => 1,
},
clean => 1,
unlike
=>
{
clean_if_exists
=>
1
,
},
},
},
unlike
=>
{
clean_if_exists
=>
1
,
},
},
'
DROP TABLE test_table
'
=>
{
'
DROP TABLE test_table
'
=>
{
regexp
=>
qr/^DROP TABLE dump_test\.test_table;/
m,
regexp
=>
qr/^DROP TABLE dump_test\.test_table;/
m,
like => {
like => { clean => 1,
},
clean => 1,
unlike
=>
{
clean_if_exists
=>
1
,
},
},
},
unlike
=>
{
clean_if_exists
=>
1
,
},
},
'
DROP TABLE fk_reference_test_table
'
=>
{
'
DROP TABLE fk_reference_test_table
'
=>
{
regexp
=>
qr/^DROP TABLE dump_test\.fk_reference_test_table;/
m,
regexp
=>
qr/^DROP TABLE dump_test\.fk_reference_test_table;/
m,
like => {
like => { clean => 1,
},
clean => 1,
unlike
=>
{
clean_if_exists
=>
1
,
},
},
},
unlike
=>
{
clean_if_exists
=>
1
,
},
},
'
DROP TABLE test_second_table
'
=>
{
'
DROP TABLE test_second_table
'
=>
{
regexp
=>
qr/^DROP TABLE dump_test\.test_second_table;/
m,
regexp
=>
qr/^DROP TABLE dump_test\.test_second_table;/
m,
like => {
like => { clean => 1,
},
clean => 1,
unlike
=>
{
clean_if_exists
=>
1
,
},
},
},
unlike
=>
{
clean_if_exists
=>
1
,
},
},
'
DROP TABLE test_third_table
'
=>
{
'
DROP TABLE test_third_table
'
=>
{
regexp
=>
qr/^DROP TABLE dump_test_second_schema\.test_third_table;/
m,
regexp
=>
qr/^DROP TABLE dump_test_second_schema\.test_third_table;/
m,
like => {
like => { clean => 1,
},
clean => 1,
unlike
=>
{
clean_if_exists
=>
1
,
},
},
},
unlike
=>
{
clean_if_exists
=>
1
,
},
},
'
DROP EXTENSION IF EXISTS plpgsql
'
=>
{
'
DROP EXTENSION IF EXISTS plpgsql
'
=>
{
regexp
=>
qr/^DROP EXTENSION IF EXISTS plpgsql;/
m,
regexp
=>
qr/^DROP EXTENSION IF EXISTS plpgsql;/
m,
like => {
like => { clean_if_exists => 1,
},
clean_if_exists => 1,
unlike
=>
{
clean
=>
1
,
},
},
},
unlike
=>
{
clean
=>
1
,
},
},
'
DROP FUNCTION IF EXISTS dump_test.pltestlang_call_handler()
'
=>
{
'
DROP FUNCTION IF EXISTS dump_test.pltestlang_call_handler()
'
=>
{
regexp
=>
qr/^
regexp
=>
qr/^
\QDROP FUNCTION IF EXISTS dump_test.pltestlang_call_handler();\E
\QDROP FUNCTION IF EXISTS dump_test.pltestlang_call_handler();\E
/
xm
,
/
xm
,
like
=>
{
like
=>
{
clean_if_exists
=>
1
,
},
clean_if_exists
=>
1
,
unlike
=>
{
clean
=>
1
,
},
},
},
unlike
=>
{
clean
=>
1
,
},
},
'
DROP LANGUAGE IF EXISTS pltestlang
'
=>
{
'
DROP LANGUAGE IF EXISTS pltestlang
'
=>
{
regexp
=>
qr/^DROP PROCEDURAL LANGUAGE IF EXISTS pltestlang;/
m,
regexp
=>
qr/^DROP PROCEDURAL LANGUAGE IF EXISTS pltestlang;/
m,
like => {
like => { clean_if_exists => 1,
},
clean_if_exists => 1,
unlike
=>
{
clean
=>
1
,
},
},
},
unlike
=>
{
clean
=>
1
,
},
},
'
DROP SCHEMA IF EXISTS dump_test
'
=>
{
'
DROP SCHEMA IF EXISTS dump_test
'
=>
{
regexp
=>
qr/^DROP SCHEMA IF EXISTS dump_test;/
m,
regexp
=>
qr/^DROP SCHEMA IF EXISTS dump_test;/
m,
like => {
like => { clean_if_exists => 1,
},
clean_if_exists => 1,
unlike
=>
{
clean
=>
1
,
},
},
},
unlike
=>
{
clean
=>
1
,
},
},
'
DROP SCHEMA IF EXISTS dump_test_second_schema
'
=>
{
'
DROP SCHEMA IF EXISTS dump_test_second_schema
'
=>
{
regexp
=>
qr/^DROP SCHEMA IF EXISTS dump_test_second_schema;/
m,
regexp
=>
qr/^DROP SCHEMA IF EXISTS dump_test_second_schema;/
m,
like => {
like => { clean_if_exists => 1,
},
clean_if_exists => 1,
unlike
=>
{
clean
=>
1
,
},
},
},
unlike
=>
{
clean
=>
1
,
},
},
'
DROP TABLE IF EXISTS test_table
'
=>
{
'
DROP TABLE IF EXISTS test_table
'
=>
{
regexp
=>
qr/^DROP TABLE IF EXISTS dump_test\.test_table;/
m,
regexp
=>
qr/^DROP TABLE IF EXISTS dump_test\.test_table;/
m,
like => {
like => { clean_if_exists => 1,
},
clean_if_exists => 1,
unlike
=>
{
clean
=>
1
,
},
},
},
unlike
=>
{
clean
=>
1
,
},
},
'
DROP TABLE IF EXISTS test_second_table
'
=>
{
'
DROP TABLE IF EXISTS test_second_table
'
=>
{
regexp
=>
qr/^DROP TABLE IF EXISTS dump_test\.test_second_table;/
m,
regexp
=>
qr/^DROP TABLE IF EXISTS dump_test\.test_second_table;/
m,
like => {
like => { clean_if_exists => 1,
},
clean_if_exists => 1,
unlike
=>
{
clean
=>
1
,
},
},
},
unlike
=>
{
clean
=>
1
,
},
},
'
DROP TABLE IF EXISTS test_third_table
'
=>
{
'
DROP TABLE IF EXISTS test_third_table
'
=>
{
regexp
=>
qr/^
regexp
=>
qr/^
\QDROP TABLE IF EXISTS dump_test_second_schema.test_third_table;\E
\QDROP TABLE IF EXISTS dump_test_second_schema.test_third_table;\E
/
xm
,
/
xm
,
like
=>
{
like
=>
{
clean_if_exists
=>
1
,
},
clean_if_exists
=>
1
,
unlike
=>
{
clean
=>
1
,
},
},
},
unlike
=>
{
clean
=>
1
,
},
},
'
DROP ROLE dump_test
'
=>
{
'
DROP ROLE dump_test
'
=>
{
regexp
=>
qr/^
regexp
=>
qr/^
\QDROP ROLE dump_test;\E
\QDROP ROLE dump_test;\E
/
xm
,
/
xm
,
like
=>
{
like
=>
{
pg_dumpall_globals_clean
=>
1
,
},
pg_dumpall_globals_clean
=>
1
,
},
unlike
=>
{
unlike
=>
{
clean
=>
1
,
clean
=>
1
,
clean_if_exists
=>
1
,
clean_if_exists
=>
1
,
},
},
},
},
'
DROP ROLE pg_
'
=>
{
'
DROP ROLE pg_
'
=>
{
regexp
=>
qr/^
regexp
=>
qr/^
\QDROP ROLE pg_\E.*;
\QDROP ROLE pg_\E.*;
/
xm
,
/
xm
,
like
=>
{
like
=>
{},
},
unlike
=>
{
unlike
=>
{
clean
=>
1
,
clean
=>
1
,
clean_if_exists
=>
1
,
clean_if_exists
=>
1
,
pg_dumpall_globals_clean
=>
1
,
pg_dumpall_globals_clean
=>
1
,
},
},
},
},
'
DROP ... commands
'
=>
{
# catch-all for DROP
'
DROP ... commands
'
=>
{
# catch-all for DROP
regexp
=>
qr/^DROP /
m,
regexp
=>
qr/^DROP /
m,
like
=> { },
# use more-specific options above
like
=> {},
# use more-specific options above
unlike
=>
{
unlike
=>
{
binary_upgrade
=>
1
,
binary_upgrade
=>
1
,
column_inserts
=>
1
,
column_inserts
=>
1
,
...
@@ -2409,9 +2022,7 @@ my %tests = (
...
@@ -2409,9 +2022,7 @@ my %tests = (
only_dump_test_schema
=>
1
,
only_dump_test_schema
=>
1
,
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals
=>
1
,
schema_only
=>
1
,
schema_only
=>
1
,
},
},
},
},
'
GRANT USAGE ON SCHEMA dump_test_second_schema
'
=>
{
'
GRANT USAGE ON SCHEMA dump_test_second_schema
'
=>
{
create_order
=>
10
,
create_order
=>
10
,
create_sql
=>
'
GRANT USAGE ON SCHEMA dump_test_second_schema
create_sql
=>
'
GRANT USAGE ON SCHEMA dump_test_second_schema
...
@@ -2430,15 +2041,12 @@ my %tests = (
...
@@ -2430,15 +2041,12 @@ my %tests = (
exclude_test_table_data
=>
1
,
exclude_test_table_data
=>
1
,
no_owner
=>
1
,
no_owner
=>
1
,
schema_only
=>
1
,
schema_only
=>
1
,
section_pre_data
=>
1
,
section_pre_data
=>
1
,
},
},
unlike
=>
{
unlike
=>
{
only_dump_test_schema
=>
1
,
only_dump_test_schema
=>
1
,
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
},
},
},
},
'
GRANT SELECT ON TABLE test_table
'
=>
{
'
GRANT SELECT ON TABLE test_table
'
=>
{
create_order
=>
5
,
create_order
=>
5
,
create_sql
=>
'
GRANT SELECT ON TABLE dump_test.test_table
create_sql
=>
'
GRANT SELECT ON TABLE dump_test.test_table
...
@@ -2456,14 +2064,11 @@ my %tests = (
...
@@ -2456,14 +2064,11 @@ my %tests = (
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
schema_only
=>
1
,
schema_only
=>
1
,
section_pre_data
=>
1
,
section_pre_data
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
},
},
unlike
=>
{
unlike
=>
{
exclude_dump_test_schema
=>
1
,
exclude_dump_test_schema
=>
1
,
exclude_test_table
=>
1
,
exclude_test_table
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals
=>
1
,
},
},
},
},
'
GRANT SELECT ON TABLE test_third_table
'
=>
{
'
GRANT SELECT ON TABLE test_third_table
'
=>
{
create_order
=>
19
,
create_order
=>
19
,
create_sql
=>
'
GRANT SELECT ON
create_sql
=>
'
GRANT SELECT ON
...
@@ -2481,15 +2086,12 @@ my %tests = (
...
@@ -2481,15 +2086,12 @@ my %tests = (
exclude_test_table_data
=>
1
,
exclude_test_table_data
=>
1
,
no_owner
=>
1
,
no_owner
=>
1
,
schema_only
=>
1
,
schema_only
=>
1
,
section_pre_data
=>
1
,
section_pre_data
=>
1
,
},
},
unlike
=>
{
unlike
=>
{
only_dump_test_schema
=>
1
,
only_dump_test_schema
=>
1
,
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
},
},
},
},
'
GRANT ALL ON SEQUENCE test_third_table_col1_seq
'
=>
{
'
GRANT ALL ON SEQUENCE test_third_table_col1_seq
'
=>
{
create_order
=>
28
,
create_order
=>
28
,
create_sql
=>
'
GRANT ALL ON SEQUENCE
create_sql
=>
'
GRANT ALL ON SEQUENCE
...
@@ -2509,18 +2111,16 @@ my %tests = (
...
@@ -2509,18 +2111,16 @@ my %tests = (
exclude_test_table_data
=>
1
,
exclude_test_table_data
=>
1
,
no_owner
=>
1
,
no_owner
=>
1
,
schema_only
=>
1
,
schema_only
=>
1
,
section_pre_data
=>
1
,
section_pre_data
=>
1
,
},
},
unlike
=>
{
unlike
=>
{
only_dump_test_schema
=>
1
,
only_dump_test_schema
=>
1
,
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
},
},
},
},
'
GRANT INSERT(col1) ON TABLE test_second_table
'
=>
{
'
GRANT INSERT(col1) ON TABLE test_second_table
'
=>
{
create_order
=>
8
,
create_order
=>
8
,
create_sql
=>
'
GRANT INSERT (col1) ON TABLE dump_test.test_second_table
create_sql
=>
'
GRANT INSERT (col1) ON TABLE dump_test.test_second_table
TO dump_test;
',
TO dump_test;
',
regexp
=>
qr/^
regexp
=>
qr/^
\QGRANT INSERT(col1) ON TABLE test_second_table TO dump_test;\E
\QGRANT INSERT(col1) ON TABLE test_second_table TO dump_test;\E
...
@@ -2537,14 +2137,11 @@ my %tests = (
...
@@ -2537,14 +2137,11 @@ my %tests = (
only_dump_test_schema
=>
1
,
only_dump_test_schema
=>
1
,
schema_only
=>
1
,
schema_only
=>
1
,
section_pre_data
=>
1
,
section_pre_data
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
},
},
unlike
=>
{
unlike
=>
{
exclude_dump_test_schema
=>
1
,
exclude_dump_test_schema
=>
1
,
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals
=>
1
,
},
},
},
},
'
GRANT EXECUTE ON FUNCTION pg_sleep() TO dump_test
'
=>
{
'
GRANT EXECUTE ON FUNCTION pg_sleep() TO dump_test
'
=>
{
create_order
=>
16
,
create_order
=>
16
,
create_sql
=>
'
GRANT EXECUTE ON FUNCTION pg_sleep(float8)
create_sql
=>
'
GRANT EXECUTE ON FUNCTION pg_sleep(float8)
...
@@ -2563,14 +2160,11 @@ my %tests = (
...
@@ -2563,14 +2160,11 @@ my %tests = (
exclude_test_table_data
=>
1
,
exclude_test_table_data
=>
1
,
no_owner
=>
1
,
no_owner
=>
1
,
schema_only
=>
1
,
schema_only
=>
1
,
section_pre_data
=>
1
,
section_pre_data
=>
1
,
},
},
unlike
=>
{
unlike
=>
{
only_dump_test_schema
=>
1
,
only_dump_test_schema
=>
1
,
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
},
},
},
},
'
GRANT SELECT (proname ...) ON TABLE pg_proc TO public
'
=>
{
'
GRANT SELECT (proname ...) ON TABLE pg_proc TO public
'
=>
{
create_order
=>
46
,
create_order
=>
46
,
create_sql
=>
'
GRANT SELECT (
create_sql
=>
'
GRANT SELECT (
...
@@ -2649,24 +2243,19 @@ my %tests = (
...
@@ -2649,24 +2243,19 @@ my %tests = (
exclude_test_table_data
=>
1
,
exclude_test_table_data
=>
1
,
no_owner
=>
1
,
no_owner
=>
1
,
schema_only
=>
1
,
schema_only
=>
1
,
section_pre_data
=>
1
,
section_pre_data
=>
1
,
},
},
unlike
=>
{
unlike
=>
{
only_dump_test_schema
=>
1
,
only_dump_test_schema
=>
1
,
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
},
},
},
},
'
GRANT commands
'
=>
{
# catch-all for GRANT commands
'
GRANT commands
'
=>
{
# catch-all for GRANT commands
regexp
=>
qr/^GRANT /
m,
regexp
=>
qr/^GRANT /
m,
like
=> { },
# use more-specific options above
like
=> {},
# use more-specific options above
unlike
=>
{
unlike
=>
{
column_inserts
=>
1
,
column_inserts
=>
1
,
data_only
=>
1
,
data_only
=>
1
,
no_privs
=>
1
,
no_privs
=>
1
,
section_data
=>
1
,
section_data
=>
1
,
},
},
},
},
'
REFRESH MATERIALIZED VIEW matview
'
=>
{
'
REFRESH MATERIALIZED VIEW matview
'
=>
{
regexp
=>
qr/^REFRESH MATERIALIZED VIEW matview;/
m,
regexp
=>
qr/^REFRESH MATERIALIZED VIEW matview;/
m,
like => {
like => {
...
@@ -2680,17 +2269,14 @@ my %tests = (
...
@@ -2680,17 +2269,14 @@ my %tests = (
no_owner
=>
1
,
no_owner
=>
1
,
only_dump_test_schema
=>
1
,
only_dump_test_schema
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
section_post_data
=>
1
,
section_post_data
=>
1
,
},
},
unlike
=>
{
unlike
=>
{
binary_upgrade
=>
1
,
binary_upgrade
=>
1
,
exclude_dump_test_schema
=>
1
,
exclude_dump_test_schema
=>
1
,
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals
=>
1
,
schema_only
=>
1
,
schema_only
=>
1
,
section_pre_data
=>
1
,
section_pre_data
=>
1
,
},
},
},
},
'
REFRESH MATERIALIZED VIEW matview_second
'
=>
{
'
REFRESH MATERIALIZED VIEW matview_second
'
=>
{
regexp
=>
qr/^
regexp
=>
qr/^
\QREFRESH MATERIALIZED VIEW matview;\E
\QREFRESH MATERIALIZED VIEW matview;\E
...
@@ -2708,17 +2294,14 @@ my %tests = (
...
@@ -2708,17 +2294,14 @@ my %tests = (
no_owner
=>
1
,
no_owner
=>
1
,
only_dump_test_schema
=>
1
,
only_dump_test_schema
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
section_post_data
=>
1
,
section_post_data
=>
1
,
},
},
unlike
=>
{
unlike
=>
{
binary_upgrade
=>
1
,
binary_upgrade
=>
1
,
exclude_dump_test_schema
=>
1
,
exclude_dump_test_schema
=>
1
,
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals
=>
1
,
schema_only
=>
1
,
schema_only
=>
1
,
section_pre_data
=>
1
,
section_pre_data
=>
1
,
},
},
},
},
'
REVOKE EXECUTE ON FUNCTION pg_sleep() FROM public
'
=>
{
'
REVOKE EXECUTE ON FUNCTION pg_sleep() FROM public
'
=>
{
create_order
=>
15
,
create_order
=>
15
,
create_sql
=>
'
REVOKE EXECUTE ON FUNCTION pg_sleep(float8)
create_sql
=>
'
REVOKE EXECUTE ON FUNCTION pg_sleep(float8)
...
@@ -2737,14 +2320,11 @@ my %tests = (
...
@@ -2737,14 +2320,11 @@ my %tests = (
exclude_test_table_data
=>
1
,
exclude_test_table_data
=>
1
,
no_owner
=>
1
,
no_owner
=>
1
,
schema_only
=>
1
,
schema_only
=>
1
,
section_pre_data
=>
1
,
section_pre_data
=>
1
,
},
},
unlike
=>
{
unlike
=>
{
only_dump_test_schema
=>
1
,
only_dump_test_schema
=>
1
,
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
},
},
},
},
'
REVOKE SELECT ON TABLE pg_proc FROM public
'
=>
{
'
REVOKE SELECT ON TABLE pg_proc FROM public
'
=>
{
create_order
=>
45
,
create_order
=>
45
,
create_sql
=>
'
REVOKE SELECT ON TABLE pg_proc FROM public;
',
create_sql
=>
'
REVOKE SELECT ON TABLE pg_proc FROM public;
',
...
@@ -2760,14 +2340,11 @@ my %tests = (
...
@@ -2760,14 +2340,11 @@ my %tests = (
exclude_test_table_data
=>
1
,
exclude_test_table_data
=>
1
,
no_owner
=>
1
,
no_owner
=>
1
,
schema_only
=>
1
,
schema_only
=>
1
,
section_pre_data
=>
1
,
section_pre_data
=>
1
,
},
},
unlike
=>
{
unlike
=>
{
only_dump_test_schema
=>
1
,
only_dump_test_schema
=>
1
,
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
},
},
},
},
'
REVOKE CREATE ON SCHEMA public FROM public
'
=>
{
'
REVOKE CREATE ON SCHEMA public FROM public
'
=>
{
create_order
=>
16
,
create_order
=>
16
,
create_sql
=>
'
REVOKE CREATE ON SCHEMA public FROM public;
',
create_sql
=>
'
REVOKE CREATE ON SCHEMA public FROM public;
',
...
@@ -2786,14 +2363,11 @@ my %tests = (
...
@@ -2786,14 +2363,11 @@ my %tests = (
exclude_test_table_data
=>
1
,
exclude_test_table_data
=>
1
,
no_owner
=>
1
,
no_owner
=>
1
,
schema_only
=>
1
,
schema_only
=>
1
,
section_pre_data
=>
1
,
section_pre_data
=>
1
,
},
},
unlike
=>
{
unlike
=>
{
only_dump_test_schema
=>
1
,
only_dump_test_schema
=>
1
,
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
},
},
},
},
'
REVOKE USAGE ON LANGUAGE plpgsql FROM public
'
=>
{
'
REVOKE USAGE ON LANGUAGE plpgsql FROM public
'
=>
{
create_order
=>
16
,
create_order
=>
16
,
create_sql
=>
'
REVOKE USAGE ON LANGUAGE plpgsql FROM public;
',
create_sql
=>
'
REVOKE USAGE ON LANGUAGE plpgsql FROM public;
',
...
@@ -2809,25 +2383,19 @@ my %tests = (
...
@@ -2809,25 +2383,19 @@ my %tests = (
exclude_test_table_data
=>
1
,
exclude_test_table_data
=>
1
,
no_owner
=>
1
,
no_owner
=>
1
,
schema_only
=>
1
,
schema_only
=>
1
,
section_pre_data
=>
1
,
section_pre_data
=>
1
,
},
},
unlike
=>
{
unlike
=>
{
only_dump_test_schema
=>
1
,
only_dump_test_schema
=>
1
,
only_dump_test_table
=>
1
,
only_dump_test_table
=>
1
,
test_schema_plus_blobs
=>
1
,
test_schema_plus_blobs
=>
1
,
},
},
},
},
'
REVOKE commands
'
=>
{
# catch-all for REVOKE commands
'
REVOKE commands
'
=>
{
# catch-all for REVOKE commands
regexp
=>
qr/^REVOKE /
m,
regexp
=>
qr/^REVOKE /
m,
like
=> { },
# use more-specific options above
like
=> {},
# use more-specific options above
unlike
=>
{
unlike
=>
{
column_inserts
=>
1
,
column_inserts
=>
1
,
data_only
=>
1
,
data_only
=>
1
,
no_privs
=>
1
,
no_privs
=>
1
,
pg_dumpall_globals
=>
1
,
pg_dumpall_globals
=>
1
,
},
},);
},
},
);
#########################################
#########################################
# Create a PG instance to test actually dumping from
# Create a PG instance to test actually dumping from
...
@@ -2841,28 +2409,34 @@ my $port = $node->port;
...
@@ -2841,28 +2409,34 @@ my $port = $node->port;
# Start with 2 because of command_exit_is() tests below
# Start with 2 because of command_exit_is() tests below
my
$num_tests
=
2
;
my
$num_tests
=
2
;
foreach
my
$run
(
sort
keys
%
pgdump_runs
)
{
foreach
my
$run
(
sort
keys
%
pgdump_runs
)
{
my
$test_key
=
$run
;
my
$test_key
=
$run
;
# Each run of pg_dump is a test itself
# Each run of pg_dump is a test itself
$num_tests
++
;
$num_tests
++
;
# If there is a restore cmd, that's another test
# If there is a restore cmd, that's another test
if
(
$pgdump_runs
{
$run
}
->
{
restore_cmd
})
{
if
(
$pgdump_runs
{
$run
}
->
{
restore_cmd
})
{
$num_tests
++
;
$num_tests
++
;
}
}
if
(
$pgdump_runs
{
$run
}
->
{
test_key
})
{
if
(
$pgdump_runs
{
$run
}
->
{
test_key
})
{
$test_key
=
$pgdump_runs
{
$run
}
->
{
test_key
};
$test_key
=
$pgdump_runs
{
$run
}
->
{
test_key
};
}
}
# Then count all the tests run against each run
# Then count all the tests run against each run
foreach
my
$test
(
sort
keys
%
tests
)
{
foreach
my
$test
(
sort
keys
%
tests
)
if
(
$tests
{
$test
}
->
{
like
}
->
{
$test_key
})
{
{
if
(
$tests
{
$test
}
->
{
like
}
->
{
$test_key
})
{
$num_tests
++
;
$num_tests
++
;
}
}
if
(
$tests
{
$test
}
->
{
unlike
}
->
{
$test_key
})
{
if
(
$tests
{
$test
}
->
{
unlike
}
->
{
$test_key
})
{
$num_tests
++
;
$num_tests
++
;
}
}
}
}
...
@@ -2877,17 +2451,26 @@ my $create_sql = '';
...
@@ -2877,17 +2451,26 @@ my $create_sql = '';
foreach
my
$test
(
foreach
my
$test
(
sort
{
sort
{
if
(
$tests
{
$a
}
->
{
create_order
}
and
$tests
{
$b
}
->
{
create_order
})
{
if
(
$tests
{
$a
}
->
{
create_order
}
and
$tests
{
$b
}
->
{
create_order
})
{
$tests
{
$a
}
->
{
create_order
}
<=>
$tests
{
$b
}
->
{
create_order
};
$tests
{
$a
}
->
{
create_order
}
<=>
$tests
{
$b
}
->
{
create_order
};
}
elsif
(
$tests
{
$a
}
->
{
create_order
})
{
}
elsif
(
$tests
{
$a
}
->
{
create_order
})
{
-
1
;
-
1
;
}
elsif
(
$tests
{
$b
}
->
{
create_order
})
{
}
elsif
(
$tests
{
$b
}
->
{
create_order
})
{
1
;
1
;
}
else
{
}
else
{
0
;
0
;
}
}
}
keys
%
tests
)
{
}
keys
%
tests
)
if
(
$tests
{
$test
}
->
{
create_sql
})
{
{
if
(
$tests
{
$test
}
->
{
create_sql
})
{
$create_sql
.=
$tests
{
$test
}
->
{
create_sql
};
$create_sql
.=
$tests
{
$test
}
->
{
create_sql
};
}
}
}
}
...
@@ -2898,26 +2481,35 @@ $node->safe_psql('postgres', $create_sql);
...
@@ -2898,26 +2481,35 @@ $node->safe_psql('postgres', $create_sql);
#########################################
#########################################
# Test connecting to a non-existent database
# Test connecting to a non-existent database
command_exit_is
([
'
pg_dump
',
'
-p
',
"
$port
",
'
qqq
'
],
command_exit_is
(
1
,
'
pg_dump: [archiver (db)] connection to database "qqq" failed: FATAL: database "qqq" does not exist
');
[
'
pg_dump
',
'
-p
',
"
$port
",
'
qqq
'
],
1
,
'
pg_dump: [archiver (db)] connection to database "qqq" failed: FATAL: database "qqq" does not exist
'
);
command_exit_is
([
'
pg_dump
',
'
-p
',
"
$port
",
'
--role=dump_test
'
],
command_exit_is
([
'
pg_dump
',
'
-p
',
"
$port
",
'
--role=dump_test
'
],
1
,
'
pg_dump: [archiver (db)] query failed: ERROR: permission denied for
');
1
,
'
pg_dump: [archiver (db)] query failed: ERROR: permission denied for
');
#########################################
#########################################
# Run all runs
# Run all runs
foreach
my
$run
(
sort
keys
%
pgdump_runs
)
{
foreach
my
$run
(
sort
keys
%
pgdump_runs
)
{
my
$test_key
=
$run
;
my
$test_key
=
$run
;
$node
->
command_ok
(
\
@
{
$pgdump_runs
{
$run
}
->
{
dump_cmd
}
},
"
$run
: pg_dump runs
");
$node
->
command_ok
(
\
@
{
$pgdump_runs
{
$run
}
->
{
dump_cmd
}
},
"
$run
: pg_dump runs
");
if
(
$pgdump_runs
{
$run
}
->
{
restore_cmd
})
{
if
(
$pgdump_runs
{
$run
}
->
{
restore_cmd
})
$node
->
command_ok
(
\
@
{
$pgdump_runs
{
$run
}
->
{
restore_cmd
}
},
"
$run
: pg_restore runs
");
{
$node
->
command_ok
(
\
@
{
$pgdump_runs
{
$run
}
->
{
restore_cmd
}
},
"
$run
: pg_restore runs
");
}
}
if
(
$pgdump_runs
{
$run
}
->
{
test_key
})
{
if
(
$pgdump_runs
{
$run
}
->
{
test_key
})
{
$test_key
=
$pgdump_runs
{
$run
}
->
{
test_key
};
$test_key
=
$pgdump_runs
{
$run
}
->
{
test_key
};
}
}
...
@@ -2927,13 +2519,19 @@ foreach my $run (sort keys %pgdump_runs) {
...
@@ -2927,13 +2519,19 @@ foreach my $run (sort keys %pgdump_runs) {
# Run all tests where this run is included
# Run all tests where this run is included
# as either a 'like' or 'unlike' test.
# as either a 'like' or 'unlike' test.
foreach
my
$test
(
sort
keys
%
tests
)
{
foreach
my
$test
(
sort
keys
%
tests
)
if
(
$tests
{
$test
}
->
{
like
}
->
{
$test_key
})
{
{
if
(
$tests
{
$test
}
->
{
like
}
->
{
$test_key
})
{
like
(
$output_file
,
$tests
{
$test
}
->
{
regexp
},
"
$run
: dumps
$test
");
like
(
$output_file
,
$tests
{
$test
}
->
{
regexp
},
"
$run
: dumps
$test
");
}
}
if
(
$tests
{
$test
}
->
{
unlike
}
->
{
$test_key
})
{
if
(
$tests
{
$test
}
->
{
unlike
}
->
{
$test_key
})
unlike
(
$output_file
,
$tests
{
$test
}
->
{
regexp
},
"
$run
: does not dump
$test
");
{
unlike
(
$output_file
,
$tests
{
$test
}
->
{
regexp
},
"
$run
: does not dump
$test
");
}
}
}
}
}
}
...
...
src/bin/pg_rewind/RewindTest.pm
View file @
3be0a62f
...
@@ -114,6 +114,7 @@ sub check_query
...
@@ -114,6 +114,7 @@ sub check_query
sub
setup_cluster
sub
setup_cluster
{
{
# Initialize master, data checksums are mandatory
# Initialize master, data checksums are mandatory
$node_master
=
get_new_node
('
master
');
$node_master
=
get_new_node
('
master
');
$node_master
->
init
(
allows_streaming
=>
1
);
$node_master
->
init
(
allows_streaming
=>
1
);
...
...
src/interfaces/ecpg/preproc/parse.pl
View file @
3be0a62f
src/test/modules/commit_ts/t/001_base.pl
View file @
3be0a62f
...
@@ -13,17 +13,21 @@ $node->append_conf('postgresql.conf', 'track_commit_timestamp = on');
...
@@ -13,17 +13,21 @@ $node->append_conf('postgresql.conf', 'track_commit_timestamp = on');
$node
->
start
;
$node
->
start
;
# Create a table, compare "now()" to the commit TS of its xmin
# Create a table, compare "now()" to the commit TS of its xmin
$node
->
safe_psql
('
postgres
',
'
create table t as select now from (select now(), pg_sleep(1)) f
');
$node
->
safe_psql
('
postgres
',
'
create table t as select now from (select now(), pg_sleep(1)) f
');
my
$true
=
$node
->
safe_psql
('
postgres
',
my
$true
=
$node
->
safe_psql
('
postgres
',
'
select t.now - ts.* <
\'
1s
\'
from t, pg_class c, pg_xact_commit_timestamp(c.xmin) ts where relname =
\'
t
\'
');
'
select t.now - ts.* <
\'
1s
\'
from t, pg_class c, pg_xact_commit_timestamp(c.xmin) ts where relname =
\'
t
\'
'
);
is
(
$true
,
'
t
',
'
commit TS is set
');
is
(
$true
,
'
t
',
'
commit TS is set
');
my
$ts
=
$node
->
safe_psql
('
postgres
',
my
$ts
=
$node
->
safe_psql
('
postgres
',
'
select ts.* from pg_class, pg_xact_commit_timestamp(xmin) ts where relname =
\'
t
\'
');
'
select ts.* from pg_class, pg_xact_commit_timestamp(xmin) ts where relname =
\'
t
\'
'
);
# Verify that we read the same TS after crash recovery
# Verify that we read the same TS after crash recovery
$node
->
stop
('
immediate
');
$node
->
stop
('
immediate
');
$node
->
start
;
$node
->
start
;
my
$recovered_ts
=
$node
->
safe_psql
('
postgres
',
my
$recovered_ts
=
$node
->
safe_psql
('
postgres
',
'
select ts.* from pg_class, pg_xact_commit_timestamp(xmin) ts where relname =
\'
t
\'
');
'
select ts.* from pg_class, pg_xact_commit_timestamp(xmin) ts where relname =
\'
t
\'
'
);
is
(
$recovered_ts
,
$ts
,
'
commit TS remains after crash recovery
');
is
(
$recovered_ts
,
$ts
,
'
commit TS remains after crash recovery
');
src/test/modules/commit_ts/t/002_standby.pl
View file @
3be0a62f
...
@@ -11,7 +11,8 @@ my $bkplabel = 'backup';
...
@@ -11,7 +11,8 @@ my $bkplabel = 'backup';
my
$master
=
get_new_node
('
master
');
my
$master
=
get_new_node
('
master
');
$master
->
init
(
allows_streaming
=>
1
);
$master
->
init
(
allows_streaming
=>
1
);
$master
->
append_conf
('
postgresql.conf
',
qq{
$master
->
append_conf
(
'
postgresql.conf
',
qq{
track_commit_timestamp = on
track_commit_timestamp = on
max_wal_senders = 5
max_wal_senders = 5
wal_level = hot_standby
wal_level = hot_standby
...
@@ -28,22 +29,24 @@ for my $i (1 .. 10)
...
@@ -28,22 +29,24 @@ for my $i (1 .. 10)
$master
->
safe_psql
('
postgres
',
"
create table t
$i
()
");
$master
->
safe_psql
('
postgres
',
"
create table t
$i
()
");
}
}
my
$master_ts
=
$master
->
safe_psql
('
postgres
',
my
$master_ts
=
$master
->
safe_psql
('
postgres
',
qq{SELECT ts.* FROM pg_class, pg_xact_commit_timestamp(xmin) AS ts WHERE relname = 't10'}
);
qq{SELECT ts.* FROM pg_class, pg_xact_commit_timestamp(xmin) AS ts WHERE relname = 't10'}
my
$master_lsn
=
$master
->
safe_psql
('
postgres
',
);
'
select pg_current_xlog_location()
');
my
$master_lsn
=
$master
->
safe_psql
('
postgres
',
'
select pg_current_xlog_location()
');
$standby
->
poll_query_until
('
postgres
',
$standby
->
poll_query_until
('
postgres
',
qq{SELECT '$master_lsn'::pg_lsn <= pg_last_xlog_replay_location()}
)
qq{SELECT '$master_lsn'::pg_lsn <= pg_last_xlog_replay_location()}
)
or
die
"
slave never caught up
";
or
die
"
slave never caught up
";
my
$standby_ts
=
$standby
->
safe_psql
('
postgres
',
my
$standby_ts
=
$standby
->
safe_psql
('
postgres
',
qq{select ts.* from pg_class, pg_xact_commit_timestamp(xmin) ts where relname = 't10'}
);
qq{select ts.* from pg_class, pg_xact_commit_timestamp(xmin) ts where relname = 't10'}
);
is
(
$master_ts
,
$standby_ts
,
"
standby gives same value as master
");
is
(
$master_ts
,
$standby_ts
,
"
standby gives same value as master
");
$master
->
append_conf
('
postgresql.conf
',
'
track_commit_timestamp = off
');
$master
->
append_conf
('
postgresql.conf
',
'
track_commit_timestamp = off
');
$master
->
restart
;
$master
->
restart
;
$master
->
safe_psql
('
postgres
',
'
checkpoint
');
$master
->
safe_psql
('
postgres
',
'
checkpoint
');
$master_lsn
=
$master
->
safe_psql
('
postgres
',
$master_lsn
=
'
select pg_current_xlog_location()
');
$master
->
safe_psql
('
postgres
',
'
select pg_current_xlog_location()
');
$standby
->
poll_query_until
('
postgres
',
$standby
->
poll_query_until
('
postgres
',
qq{SELECT '$master_lsn'::pg_lsn <= pg_last_xlog_replay_location()}
)
qq{SELECT '$master_lsn'::pg_lsn <= pg_last_xlog_replay_location()}
)
or
die
"
slave never caught up
";
or
die
"
slave never caught up
";
...
@@ -51,7 +54,12 @@ $standby->safe_psql('postgres', 'checkpoint');
...
@@ -51,7 +54,12 @@ $standby->safe_psql('postgres', 'checkpoint');
# This one should raise an error now
# This one should raise an error now
my
(
$ret
,
$standby_ts_stdout
,
$standby_ts_stderr
)
=
$standby
->
psql
('
postgres
',
my
(
$ret
,
$standby_ts_stdout
,
$standby_ts_stderr
)
=
$standby
->
psql
('
postgres
',
'
select ts.* from pg_class, pg_xact_commit_timestamp(xmin) ts where relname =
\'
t10
\'
');
'
select ts.* from pg_class, pg_xact_commit_timestamp(xmin) ts where relname =
\'
t10
\'
'
);
is
(
$ret
,
3
,
'
standby errors when master turned feature off
');
is
(
$ret
,
3
,
'
standby errors when master turned feature off
');
is
(
$standby_ts_stdout
,
'',
"
standby gives no value when master turned feature off
");
is
(
$standby_ts_stdout
,
'',
like
(
$standby_ts_stderr
,
qr/could not get commit timestamp data/
,
'
expected error when master turned feature off
');
"
standby gives no value when master turned feature off
");
like
(
$standby_ts_stderr
,
qr/could not get commit timestamp data/
,
'
expected error when master turned feature off
');
src/test/modules/commit_ts/t/003_standby_2.pl
View file @
3be0a62f
...
@@ -10,7 +10,8 @@ use PostgresNode;
...
@@ -10,7 +10,8 @@ use PostgresNode;
my
$bkplabel
=
'
backup
';
my
$bkplabel
=
'
backup
';
my
$master
=
get_new_node
('
master
');
my
$master
=
get_new_node
('
master
');
$master
->
init
(
allows_streaming
=>
1
);
$master
->
init
(
allows_streaming
=>
1
);
$master
->
append_conf
('
postgresql.conf
',
qq{
$master
->
append_conf
(
'
postgresql.conf
',
qq{
track_commit_timestamp = on
track_commit_timestamp = on
max_wal_senders = 5
max_wal_senders = 5
wal_level = hot_standby
wal_level = hot_standby
...
@@ -29,8 +30,8 @@ for my $i (1 .. 10)
...
@@ -29,8 +30,8 @@ for my $i (1 .. 10)
$master
->
append_conf
('
postgresql.conf
',
'
track_commit_timestamp = off
');
$master
->
append_conf
('
postgresql.conf
',
'
track_commit_timestamp = off
');
$master
->
restart
;
$master
->
restart
;
$master
->
safe_psql
('
postgres
',
'
checkpoint
');
$master
->
safe_psql
('
postgres
',
'
checkpoint
');
my
$master_lsn
=
$master
->
safe_psql
('
postgres
',
my
$master_lsn
=
'
select pg_current_xlog_location()
');
$master
->
safe_psql
('
postgres
',
'
select pg_current_xlog_location()
');
$standby
->
poll_query_until
('
postgres
',
$standby
->
poll_query_until
('
postgres
',
qq{SELECT '$master_lsn'::pg_lsn <= pg_last_xlog_replay_location()}
)
qq{SELECT '$master_lsn'::pg_lsn <= pg_last_xlog_replay_location()}
)
or
die
"
slave never caught up
";
or
die
"
slave never caught up
";
...
@@ -38,11 +39,16 @@ $standby->poll_query_until('postgres',
...
@@ -38,11 +39,16 @@ $standby->poll_query_until('postgres',
$standby
->
safe_psql
('
postgres
',
'
checkpoint
');
$standby
->
safe_psql
('
postgres
',
'
checkpoint
');
$standby
->
restart
;
$standby
->
restart
;
my
(
$psql_ret
,
$standby_ts_stdout
,
$standby_ts_stderr
)
=
$standby
->
psql
('
postgres
',
my
(
$psql_ret
,
$standby_ts_stdout
,
$standby_ts_stderr
)
=
$standby
->
psql
(
qq{SELECT ts.* FROM pg_class, pg_xact_commit_timestamp(xmin) AS ts WHERE relname = 't10'}
);
'
postgres
',
qq{SELECT ts.* FROM pg_class, pg_xact_commit_timestamp(xmin) AS ts WHERE relname = 't10'}
);
is
(
$psql_ret
,
3
,
'
expect error when getting commit timestamp after restart
');
is
(
$psql_ret
,
3
,
'
expect error when getting commit timestamp after restart
');
is
(
$standby_ts_stdout
,
'',
"
standby does not return a value after restart
");
is
(
$standby_ts_stdout
,
'',
"
standby does not return a value after restart
");
like
(
$standby_ts_stderr
,
qr/could not get commit timestamp data/
,
'
expected err msg after restart
');
like
(
$standby_ts_stderr
,
qr/could not get commit timestamp data/
,
'
expected err msg after restart
');
$master
->
append_conf
('
postgresql.conf
',
'
track_commit_timestamp = on
');
$master
->
append_conf
('
postgresql.conf
',
'
track_commit_timestamp = on
');
$master
->
restart
;
$master
->
restart
;
...
@@ -54,5 +60,7 @@ $standby->poll_query_until('postgres', "SELECT pg_is_in_recovery() <> true");
...
@@ -54,5 +60,7 @@ $standby->poll_query_until('postgres', "SELECT pg_is_in_recovery() <> true");
$standby
->
safe_psql
('
postgres
',
"
create table t11()
");
$standby
->
safe_psql
('
postgres
',
"
create table t11()
");
my
$standby_ts
=
$standby
->
safe_psql
('
postgres
',
my
$standby_ts
=
$standby
->
safe_psql
('
postgres
',
qq{SELECT ts.* FROM pg_class, pg_xact_commit_timestamp(xmin) AS ts WHERE relname = 't11'}
);
qq{SELECT ts.* FROM pg_class, pg_xact_commit_timestamp(xmin) AS ts WHERE relname = 't11'}
isnt
(
$standby_ts
,
'',
"
standby gives valid value (
$standby_ts
) after promotion
");
);
isnt
(
$standby_ts
,
'',
"
standby gives valid value (
$standby_ts
) after promotion
");
src/test/modules/test_pg_dump/t/001_base.pl
View file @
3be0a62f
...
@@ -46,16 +46,14 @@ my %pgdump_runs = (
...
@@ -46,16 +46,14 @@ my %pgdump_runs = (
'
--schema-only
',
'
--schema-only
',
'
--binary-upgrade
',
'
--binary-upgrade
',
'
-d
',
'
postgres
',
# alternative way to specify database
'
-d
',
'
postgres
',
# alternative way to specify database
],
],
},
},
clean
=>
{
clean
=>
{
dump_cmd
=>
[
dump_cmd
=>
[
'
pg_dump
',
'
pg_dump
',
'
-f
',
"
$tempdir
/clean.sql
",
'
-f
',
"
$tempdir
/clean.sql
",
'
-c
',
'
-c
',
'
-d
',
'
postgres
',
# alternative way to specify database
'
-d
',
'
postgres
',
# alternative way to specify database
],
],
},
},
clean_if_exists
=>
{
clean_if_exists
=>
{
dump_cmd
=>
[
dump_cmd
=>
[
'
pg_dump
',
'
pg_dump
',
...
@@ -63,157 +61,94 @@ my %pgdump_runs = (
...
@@ -63,157 +61,94 @@ my %pgdump_runs = (
'
-c
',
'
-c
',
'
--if-exists
',
'
--if-exists
',
'
-E
',
'
UTF8
',
# no-op, just tests that option is accepted
'
-E
',
'
UTF8
',
# no-op, just tests that option is accepted
'
postgres
',
'
postgres
',
],
},
],
},
column_inserts
=>
{
column_inserts
=>
{
dump_cmd
=>
[
dump_cmd
=>
[
'
pg_dump
',
'
pg_dump
',
'
-f
',
'
-f
',
"
$tempdir
/column_inserts.sql
",
"
$tempdir
/column_inserts.sql
",
'
-a
',
'
-a
',
'
--column-inserts
',
'
postgres
',
],
},
'
--column-inserts
',
'
postgres
',
],
},
createdb
=>
{
createdb
=>
{
dump_cmd
=>
[
dump_cmd
=>
[
'
pg_dump
',
'
pg_dump
',
'
-f
',
"
$tempdir
/createdb.sql
",
'
-f
',
"
$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
",
'
-f
',
"
$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
',
'
-f
',
'
-Fc
',
"
$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
",
'
-f
',
"
$tempdir
/defaults_custom_format.dump
",
"
$tempdir
/defaults_custom_format.sql
",
],
"
$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
',
'
-f
',
"
$tempdir
/defaults_dir_format
",
'
-Fd
',
'
postgres
',
],
'
-f
',
"
$tempdir
/defaults_dir_format
",
'
postgres
',
],
restore_cmd
=>
[
restore_cmd
=>
[
'
pg_restore
',
'
pg_restore
',
'
-f
',
"
$tempdir
/defaults_dir_format.sql
",
'
-f
',
"
$tempdir
/defaults_dir_format
",
"
$tempdir
/defaults_dir_format.sql
",
],
"
$tempdir
/defaults_dir_format
",
],
},
},
defaults_parallel
=>
{
defaults_parallel
=>
{
test_key
=>
'
defaults
',
test_key
=>
'
defaults
',
dump_cmd
=>
[
dump_cmd
=>
[
'
pg_dump
',
'
pg_dump
',
'
-Fd
',
'
-j2
',
'
-f
',
"
$tempdir
/defaults_parallel
",
'
-Fd
',
'
postgres
',
],
'
-j2
',
'
-f
',
"
$tempdir
/defaults_parallel
",
'
postgres
',
],
restore_cmd
=>
[
restore_cmd
=>
[
'
pg_restore
',
'
pg_restore
',
'
-f
',
'
-f
',
"
$tempdir
/defaults_parallel.sql
",
"
$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
',
'
-f
',
"
$tempdir
/defaults_tar_format.tar
",
'
-Ft
',
'
postgres
',
],
'
-f
',
"
$tempdir
/defaults_tar_format.tar
",
'
postgres
',
],
restore_cmd
=>
[
restore_cmd
=>
[
'
pg_restore
',
'
pg_restore
',
'
-f
',
"
$tempdir
/defaults_tar_format.sql
",
'
-f
',
"
$tempdir
/defaults_tar_format.tar
",
"
$tempdir
/defaults_tar_format.sql
",
],
"
$tempdir
/defaults_tar_format.tar
",
],
},
},
pg_dumpall_globals
=>
{
pg_dumpall_globals
=>
{
dump_cmd
=>
[
dump_cmd
=>
'
pg_dumpall
',
[
'
pg_dumpall
',
'
-f
',
"
$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
',
'
-f
',
"
$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
',
'
-f
',
"
$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
',
'
-f
',
"
$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
',
'
-f
',
"
$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
',
'
-f
',
'
-f
',
"
$tempdir
/section_data.sql
",
"
$tempdir
/section_data.sql
",
'
--section=data
',
'
--section=data
',
'
postgres
',
],
},
'
postgres
',
],
},
section_post_data
=>
{
section_post_data
=>
{
dump_cmd
=>
[
dump_cmd
=>
[
'
pg_dump
',
'
pg_dump
',
'
-f
',
"
$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.
...
@@ -267,21 +202,16 @@ my %tests = (
...
@@ -267,21 +202,16 @@ 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 dump_test
'
=>
{
'
CREATE ROLE dump_test
'
=>
{
create_order
=>
1
,
create_order
=>
1
,
create_sql
=>
'
CREATE ROLE dump_test;
',
create_sql
=>
'
CREATE ROLE dump_test;
',
regexp
=>
qr/^CREATE ROLE dump_test;$/
m,
regexp
=>
qr/^CREATE ROLE dump_test;$/
m,
like => {
like => { pg_dumpall_globals => 1,
},
pg_dumpall_globals => 1,
},
unlike
=>
{
unlike
=>
{
binary_upgrade
=>
1
,
binary_upgrade
=>
1
,
clean
=>
1
,
clean
=>
1
,
...
@@ -292,18 +222,14 @@ my %tests = (
...
@@ -292,18 +222,14 @@ 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 TABLE regress_pg_dump_table
'
=>
{
'
CREATE TABLE regress_pg_dump_table
'
=>
{
regexp
=>
qr/^
regexp
=>
qr/^
\QCREATE TABLE regress_pg_dump_table (\E
\QCREATE TABLE regress_pg_dump_table (\E
\n\s+\Qcol1 integer,\E
\n\s+\Qcol1 integer,\E
\n\s+\Qcol2 integer\E
\n\s+\Qcol2 integer\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
,
...
@@ -314,16 +240,12 @@ my %tests = (
...
@@ -314,16 +240,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
,
},
},
},
},
'
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
$/
xm
,
$/
xm
,
like
=>
{
like
=>
{
binary_upgrade
=>
1
,
},
binary_upgrade
=>
1
,
},
unlike
=>
{
unlike
=>
{
clean
=>
1
,
clean
=>
1
,
clean_if_exists
=>
1
,
clean_if_exists
=>
1
,
...
@@ -334,9 +256,7 @@ my %tests = (
...
@@ -334,9 +256,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/^
\QCOMMENT ON EXTENSION test_pg_dump \E
\QCOMMENT ON EXTENSION test_pg_dump \E
...
@@ -351,22 +271,17 @@ my %tests = (
...
@@ -351,22 +271,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
=>
{
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/^
\QSELECT pg_catalog.binary_upgrade_set_record_init_privs(true);\E\n
\QSELECT pg_catalog.binary_upgrade_set_record_init_privs(true);\E\n
\QGRANT SELECT ON TABLE regress_pg_dump_table TO dump_test;\E\n
\QGRANT SELECT ON TABLE regress_pg_dump_table TO dump_test;\E\n
\QSELECT pg_catalog.binary_upgrade_set_record_init_privs(false);\E
\QSELECT pg_catalog.binary_upgrade_set_record_init_privs(false);\E
$/
xms
,
$/
xms
,
like
=>
{
like
=>
{
binary_upgrade
=>
1
,
},
binary_upgrade
=>
1
,
},
unlike
=>
{
unlike
=>
{
clean
=>
1
,
clean
=>
1
,
clean_if_exists
=>
1
,
clean_if_exists
=>
1
,
...
@@ -377,18 +292,14 @@ my %tests = (
...
@@ -377,18 +292,14 @@ 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/^
\QSELECT pg_catalog.binary_upgrade_set_record_init_privs(true);\E\n
\QSELECT pg_catalog.binary_upgrade_set_record_init_privs(true);\E\n
\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
$/
xms
,
$/
xms
,
like
=>
{
like
=>
{
binary_upgrade
=>
1
,
},
binary_upgrade
=>
1
,
},
unlike
=>
{
unlike
=>
{
clean
=>
1
,
clean
=>
1
,
clean_if_exists
=>
1
,
clean_if_exists
=>
1
,
...
@@ -399,9 +310,7 @@ my %tests = (
...
@@ -399,9 +310,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(col2) ON regress_pg_dump_table TO dump_test
'
=>
{
'
GRANT SELECT(col2) ON regress_pg_dump_table TO dump_test
'
=>
{
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
...
@@ -417,14 +326,11 @@ my %tests = (
...
@@ -417,14 +326,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
,
},
},
},
},
'
REVOKE SELECT(col1) ON regress_pg_dump_table
'
=>
{
'
REVOKE SELECT(col1) ON regress_pg_dump_table
'
=>
{
create_order
=>
3
,
create_order
=>
3
,
create_sql
=>
'
REVOKE SELECT(col1) ON regress_pg_dump_table
create_sql
=>
'
REVOKE SELECT(col1) ON regress_pg_dump_table
...
@@ -440,15 +346,11 @@ my %tests = (
...
@@ -440,15 +346,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
,
},
},);
},
},
);
#########################################
#########################################
# Create a PG instance to test actually dumping from
# Create a PG instance to test actually dumping from
...
@@ -461,28 +363,34 @@ my $port = $node->port;
...
@@ -461,28 +363,34 @@ my $port = $node->port;
my
$num_tests
=
0
;
my
$num_tests
=
0
;
foreach
my
$run
(
sort
keys
%
pgdump_runs
)
{
foreach
my
$run
(
sort
keys
%
pgdump_runs
)
{
my
$test_key
=
$run
;
my
$test_key
=
$run
;
# Each run of pg_dump is a test itself
# Each run of pg_dump is a test itself
$num_tests
++
;
$num_tests
++
;
# If there is a restore cmd, that's another test
# If there is a restore cmd, that's another test
if
(
$pgdump_runs
{
$run
}
->
{
restore_cmd
})
{
if
(
$pgdump_runs
{
$run
}
->
{
restore_cmd
})
{
$num_tests
++
;
$num_tests
++
;
}
}
if
(
$pgdump_runs
{
$run
}
->
{
test_key
})
{
if
(
$pgdump_runs
{
$run
}
->
{
test_key
})
{
$test_key
=
$pgdump_runs
{
$run
}
->
{
test_key
};
$test_key
=
$pgdump_runs
{
$run
}
->
{
test_key
};
}
}
# Then count all the tests run against each run
# Then count all the tests run against each run
foreach
my
$test
(
sort
keys
%
tests
)
{
foreach
my
$test
(
sort
keys
%
tests
)
if
(
$tests
{
$test
}
->
{
like
}
->
{
$test_key
})
{
{
if
(
$tests
{
$test
}
->
{
like
}
->
{
$test_key
})
{
$num_tests
++
;
$num_tests
++
;
}
}
if
(
$tests
{
$test
}
->
{
unlike
}
->
{
$test_key
})
{
if
(
$tests
{
$test
}
->
{
unlike
}
->
{
$test_key
})
{
$num_tests
++
;
$num_tests
++
;
}
}
}
}
...
@@ -497,17 +405,26 @@ my $create_sql = '';
...
@@ -497,17 +405,26 @@ my $create_sql = '';
foreach
my
$test
(
foreach
my
$test
(
sort
{
sort
{
if
(
$tests
{
$a
}
->
{
create_order
}
and
$tests
{
$b
}
->
{
create_order
})
{
if
(
$tests
{
$a
}
->
{
create_order
}
and
$tests
{
$b
}
->
{
create_order
})
{
$tests
{
$a
}
->
{
create_order
}
<=>
$tests
{
$b
}
->
{
create_order
};
$tests
{
$a
}
->
{
create_order
}
<=>
$tests
{
$b
}
->
{
create_order
};
}
elsif
(
$tests
{
$a
}
->
{
create_order
})
{
}
elsif
(
$tests
{
$a
}
->
{
create_order
})
{
-
1
;
-
1
;
}
elsif
(
$tests
{
$b
}
->
{
create_order
})
{
}
elsif
(
$tests
{
$b
}
->
{
create_order
})
{
1
;
1
;
}
else
{
}
else
{
0
;
0
;
}
}
}
keys
%
tests
)
{
}
keys
%
tests
)
if
(
$tests
{
$test
}
->
{
create_sql
})
{
{
if
(
$tests
{
$test
}
->
{
create_sql
})
{
$create_sql
.=
$tests
{
$test
}
->
{
create_sql
};
$create_sql
.=
$tests
{
$test
}
->
{
create_sql
};
}
}
}
}
...
@@ -518,17 +435,22 @@ $node->safe_psql('postgres', $create_sql);
...
@@ -518,17 +435,22 @@ $node->safe_psql('postgres', $create_sql);
#########################################
#########################################
# Run all runs
# Run all runs
foreach
my
$run
(
sort
keys
%
pgdump_runs
)
{
foreach
my
$run
(
sort
keys
%
pgdump_runs
)
{
my
$test_key
=
$run
;
my
$test_key
=
$run
;
$node
->
command_ok
(
\
@
{
$pgdump_runs
{
$run
}
->
{
dump_cmd
}
},
"
$run
: pg_dump runs
");
$node
->
command_ok
(
\
@
{
$pgdump_runs
{
$run
}
->
{
dump_cmd
}
},
"
$run
: pg_dump runs
");
if
(
$pgdump_runs
{
$run
}
->
{
restore_cmd
})
{
if
(
$pgdump_runs
{
$run
}
->
{
restore_cmd
})
$node
->
command_ok
(
\
@
{
$pgdump_runs
{
$run
}
->
{
restore_cmd
}
},
"
$run
: pg_restore runs
");
{
$node
->
command_ok
(
\
@
{
$pgdump_runs
{
$run
}
->
{
restore_cmd
}
},
"
$run
: pg_restore runs
");
}
}
if
(
$pgdump_runs
{
$run
}
->
{
test_key
})
{
if
(
$pgdump_runs
{
$run
}
->
{
test_key
})
{
$test_key
=
$pgdump_runs
{
$run
}
->
{
test_key
};
$test_key
=
$pgdump_runs
{
$run
}
->
{
test_key
};
}
}
...
@@ -538,13 +460,19 @@ foreach my $run (sort keys %pgdump_runs) {
...
@@ -538,13 +460,19 @@ foreach my $run (sort keys %pgdump_runs) {
# Run all tests where this run is included
# Run all tests where this run is included
# as either a 'like' or 'unlike' test.
# as either a 'like' or 'unlike' test.
foreach
my
$test
(
sort
keys
%
tests
)
{
foreach
my
$test
(
sort
keys
%
tests
)
if
(
$tests
{
$test
}
->
{
like
}
->
{
$test_key
})
{
{
if
(
$tests
{
$test
}
->
{
like
}
->
{
$test_key
})
{
like
(
$output_file
,
$tests
{
$test
}
->
{
regexp
},
"
$run
: dumps
$test
");
like
(
$output_file
,
$tests
{
$test
}
->
{
regexp
},
"
$run
: dumps
$test
");
}
}
if
(
$tests
{
$test
}
->
{
unlike
}
->
{
$test_key
})
{
if
(
$tests
{
$test
}
->
{
unlike
}
->
{
$test_key
})
unlike
(
$output_file
,
$tests
{
$test
}
->
{
regexp
},
"
$run
: does not dump
$test
");
{
unlike
(
$output_file
,
$tests
{
$test
}
->
{
regexp
},
"
$run
: does not dump
$test
");
}
}
}
}
}
}
...
...
src/test/perl/PostgresNode.pm
View file @
3be0a62f
...
@@ -103,6 +103,7 @@ our ($test_localhost, $test_pghost, $last_port_assigned, @all_nodes);
...
@@ -103,6 +103,7 @@ our ($test_localhost, $test_pghost, $last_port_assigned, @all_nodes);
INIT
INIT
{
{
# PGHOST is set once and for all through a single series of tests when
# PGHOST is set once and for all through a single series of tests when
# this module is loaded.
# this module is loaded.
$test_localhost
=
"
127.0.0.1
";
$test_localhost
=
"
127.0.0.1
";
...
@@ -540,11 +541,12 @@ sub _backup_fs
...
@@ -540,11 +541,12 @@ sub _backup_fs
if
(
$hot
)
if
(
$hot
)
{
{
# We ignore pg_stop_backup's return value. We also assume archiving
# We ignore pg_stop_backup's return value. We also assume archiving
# is enabled; otherwise the caller will have to copy the remaining
# is enabled; otherwise the caller will have to copy the remaining
# segments.
# segments.
my
$stdout
=
$self
->
safe_psql
('
postgres
',
my
$stdout
=
'
SELECT * FROM pg_stop_backup();
');
$self
->
safe_psql
('
postgres
',
'
SELECT * FROM pg_stop_backup();
');
print
"
# pg_stop_backup:
$stdout
\n
";
print
"
# pg_stop_backup:
$stdout
\n
";
}
}
...
@@ -842,6 +844,7 @@ sub get_new_node
...
@@ -842,6 +844,7 @@ sub get_new_node
while
(
$found
==
0
)
while
(
$found
==
0
)
{
{
# advance $port, wrapping correctly around range end
# advance $port, wrapping correctly around range end
$port
=
49152
if
++
$port
>=
65536
;
$port
=
49152
if
++
$port
>=
65536
;
print
"
# Checking port
$port
\n
";
print
"
# Checking port
$port
\n
";
...
@@ -896,6 +899,7 @@ sub get_new_node
...
@@ -896,6 +899,7 @@ sub get_new_node
# order, later when the File::Temp objects are destroyed.
# order, later when the File::Temp objects are destroyed.
END
END
{
{
# take care not to change the script's exit value
# take care not to change the script's exit value
my
$exit_code
=
$?
;
my
$exit_code
=
$?
;
...
@@ -1078,7 +1082,7 @@ sub psql
...
@@ -1078,7 +1082,7 @@ sub psql
IPC::Run::
timeout
(
$params
{
timeout
},
exception
=>
$timeout_exception
)
IPC::Run::
timeout
(
$params
{
timeout
},
exception
=>
$timeout_exception
)
if
(
defined
(
$params
{
timeout
}));
if
(
defined
(
$params
{
timeout
}));
$
{
$params
{
timed_out
}
}
=
0
if
defined
$params
{
timed_out
};
$
{
$params
{
timed_out
}
}
=
0
if
defined
$params
{
timed_out
};
# IPC::Run would otherwise append to existing contents:
# IPC::Run would otherwise append to existing contents:
$$stdout
=
""
if
ref
(
$stdout
);
$$stdout
=
""
if
ref
(
$stdout
);
...
@@ -1107,6 +1111,7 @@ sub psql
...
@@ -1107,6 +1111,7 @@ sub psql
my
$exc_save
=
$@
;
my
$exc_save
=
$@
;
if
(
$exc_save
)
if
(
$exc_save
)
{
{
# IPC::Run::run threw an exception. re-throw unless it's a
# IPC::Run::run threw an exception. re-throw unless it's a
# timeout, which we'll handle by testing is_expired
# timeout, which we'll handle by testing is_expired
die
$exc_save
die
$exc_save
...
...
src/test/perl/RecursiveCopy.pm
View file @
3be0a62f
...
@@ -93,7 +93,8 @@ sub _copypath_recurse
...
@@ -93,7 +93,8 @@ sub _copypath_recurse
# Can't handle symlinks or other weird things
# Can't handle symlinks or other weird things
die
"
Source path
\"
$srcpath
\"
is not a regular file or directory
"
die
"
Source path
\"
$srcpath
\"
is not a regular file or directory
"
unless
-
f
$srcpath
or
-
d
$srcpath
;
unless
-
f
$srcpath
or
-
d
$srcpath
;
# Abort if destination path already exists. Should we allow directories
# Abort if destination path already exists. Should we allow directories
# to exist already?
# to exist already?
...
...
src/test/perl/TestLib.pm
View file @
3be0a62f
...
@@ -109,6 +109,7 @@ INIT
...
@@ -109,6 +109,7 @@ INIT
END
END
{
{
# Preserve temporary directory for this test on failure
# Preserve temporary directory for this test on failure
$
File::Temp::
KEEP_ALL
=
1
unless
all_tests_passing
();
$
File::Temp::
KEEP_ALL
=
1
unless
all_tests_passing
();
}
}
...
...
src/test/recovery/t/001_stream_rep.pl
View file @
3be0a62f
...
@@ -51,10 +51,13 @@ my $result =
...
@@ -51,10 +51,13 @@ my $result =
print
"
standby 1:
$result
\n
";
print
"
standby 1:
$result
\n
";
is
(
$result
,
qq(1002)
,
'
check streamed content on standby 1
');
is
(
$result
,
qq(1002)
,
'
check streamed content on standby 1
');
$result
=
$node_standby_2
->
safe_psql
('
postgres
',
"
SELECT count(*) FROM tab_int
");
$result
=
$node_standby_2
->
safe_psql
('
postgres
',
"
SELECT count(*) FROM tab_int
");
print
"
standby 2:
$result
\n
";
print
"
standby 2:
$result
\n
";
is
(
$result
,
qq(1002)
,
'
check streamed content on standby 2
');
is
(
$result
,
qq(1002)
,
'
check streamed content on standby 2
');
# Check that only READ-only queries can run on standbys
# Check that only READ-only queries can run on standbys
is
(
$node_standby_1
->
psql
('
postgres
',
'
INSERT INTO tab_int VALUES (1)
'),
3
,
'
Read-only queries on standby 1
');
is
(
$node_standby_1
->
psql
('
postgres
',
'
INSERT INTO tab_int VALUES (1)
'),
is
(
$node_standby_2
->
psql
('
postgres
',
'
INSERT INTO tab_int VALUES (1)
'),
3
,
'
Read-only queries on standby 2
');
3
,
'
Read-only queries on standby 1
');
is
(
$node_standby_2
->
psql
('
postgres
',
'
INSERT INTO tab_int VALUES (1)
'),
3
,
'
Read-only queries on standby 2
');
src/test/recovery/t/002_archiving.pl
View file @
3be0a62f
...
@@ -48,5 +48,6 @@ my $caughtup_query =
...
@@ -48,5 +48,6 @@ my $caughtup_query =
$node_standby
->
poll_query_until
('
postgres
',
$caughtup_query
)
$node_standby
->
poll_query_until
('
postgres
',
$caughtup_query
)
or
die
"
Timed out while waiting for standby to catch up
";
or
die
"
Timed out while waiting for standby to catch up
";
my
$result
=
$node_standby
->
safe_psql
('
postgres
',
"
SELECT count(*) FROM tab_int
");
my
$result
=
$node_standby
->
safe_psql
('
postgres
',
"
SELECT count(*) FROM tab_int
");
is
(
$result
,
qq(1000)
,
'
check content from archives
');
is
(
$result
,
qq(1000)
,
'
check content from archives
');
src/test/recovery/t/003_recovery_targets.pl
View file @
3be0a62f
...
@@ -66,7 +66,8 @@ $node_master->backup('my_backup');
...
@@ -66,7 +66,8 @@ $node_master->backup('my_backup');
# target TXID.
# target TXID.
$node_master
->
safe_psql
('
postgres
',
$node_master
->
safe_psql
('
postgres
',
"
INSERT INTO tab_int VALUES (generate_series(1001,2000))
");
"
INSERT INTO tab_int VALUES (generate_series(1001,2000))
");
my
$recovery_txid
=
$node_master
->
safe_psql
('
postgres
',
"
SELECT txid_current()
");
my
$recovery_txid
=
$node_master
->
safe_psql
('
postgres
',
"
SELECT txid_current()
");
my
$lsn2
=
my
$lsn2
=
$node_master
->
safe_psql
('
postgres
',
"
SELECT pg_current_xlog_location();
");
$node_master
->
safe_psql
('
postgres
',
"
SELECT pg_current_xlog_location();
");
...
...
src/test/recovery/t/004_timeline_switch.pl
View file @
3be0a62f
...
@@ -63,8 +63,8 @@ $node_standby_1->poll_query_until('postgres',
...
@@ -63,8 +63,8 @@ $node_standby_1->poll_query_until('postgres',
"
SELECT pg_is_in_recovery() <> true
");
"
SELECT pg_is_in_recovery() <> true
");
$node_standby_1
->
safe_psql
('
postgres
',
$node_standby_1
->
safe_psql
('
postgres
',
"
INSERT INTO tab_int VALUES (generate_series(1001,2000))
");
"
INSERT INTO tab_int VALUES (generate_series(1001,2000))
");
$until_lsn
=
$until_lsn
=
$node_standby_1
->
safe_psql
('
postgres
',
$node_standby_1
->
safe_psql
('
postgres
',
"
SELECT pg_current_xlog_location();
");
"
SELECT pg_current_xlog_location();
");
$caughtup_query
=
$caughtup_query
=
"
SELECT '
$until_lsn
'::pg_lsn <= pg_last_xlog_replay_location()
";
"
SELECT '
$until_lsn
'::pg_lsn <= pg_last_xlog_replay_location()
";
$node_standby_2
->
poll_query_until
('
postgres
',
$caughtup_query
)
$node_standby_2
->
poll_query_until
('
postgres
',
$caughtup_query
)
...
...
src/test/recovery/t/005_replay_delay.pl
View file @
3be0a62f
...
@@ -47,10 +47,11 @@ my $until_lsn =
...
@@ -47,10 +47,11 @@ my $until_lsn =
my
$remaining
=
90
;
my
$remaining
=
90
;
while
(
$remaining
--
>
0
)
while
(
$remaining
--
>
0
)
{
{
# Done waiting?
# Done waiting?
my
$replay_status
=
my
$replay_status
=
$node_standby
->
safe_psql
('
postgres
',
$node_standby
->
safe_psql
('
postgres
',
"
SELECT (pg_last_xlog_replay_location() - '
$until_lsn
'::pg_lsn) >= 0
"
"
SELECT (pg_last_xlog_replay_location() - '
$until_lsn
'::pg_lsn) >= 0
"
);
);
last
if
$replay_status
eq
'
t
';
last
if
$replay_status
eq
'
t
';
# No, sleep some more.
# No, sleep some more.
...
@@ -59,7 +60,8 @@ while ($remaining-- > 0)
...
@@ -59,7 +60,8 @@ while ($remaining-- > 0)
sleep
$sleep
;
sleep
$sleep
;
}
}
die
"
Maximum number of attempts reached (
$remaining
remain)
"
if
$remaining
<
0
;
die
"
Maximum number of attempts reached (
$remaining
remain)
"
if
$remaining
<
0
;
# This test is successful if and only if the LSN has been applied with at least
# This test is successful if and only if the LSN has been applied with at least
# the configured apply delay.
# the configured apply delay.
...
...
src/test/recovery/t/007_sync_rep.pl
View file @
3be0a62f
...
@@ -6,7 +6,8 @@ use TestLib;
...
@@ -6,7 +6,8 @@ use TestLib;
use
Test::
More
tests
=>
8
;
use
Test::
More
tests
=>
8
;
# Query checking sync_priority and sync_state of each standby
# Query checking sync_priority and sync_state of each standby
my
$check_sql
=
"
SELECT application_name, sync_priority, sync_state FROM pg_stat_replication ORDER BY application_name;
";
my
$check_sql
=
"
SELECT application_name, sync_priority, sync_state FROM pg_stat_replication ORDER BY application_name;
";
# Check that sync_state of each standby is expected.
# Check that sync_state of each standby is expected.
# If $setting is given, synchronous_standby_names is set to it and
# If $setting is given, synchronous_standby_names is set to it and
...
@@ -71,7 +72,8 @@ $node_standby_3->start;
...
@@ -71,7 +72,8 @@ $node_standby_3->start;
# Check that sync_state is determined correctly when
# Check that sync_state is determined correctly when
# synchronous_standby_names is specified in old syntax.
# synchronous_standby_names is specified in old syntax.
test_sync_state
(
$node_master
,
qq(standby1|1|sync
test_sync_state
(
$node_master
,
qq(standby1|1|sync
standby2|2|potential
standby2|2|potential
standby3|0|async)
,
standby3|0|async)
,
'
old syntax of synchronous_standby_names
',
'
old syntax of synchronous_standby_names
',
...
@@ -82,7 +84,8 @@ standby3|0|async),
...
@@ -82,7 +84,8 @@ standby3|0|async),
# Note that standby1 is chosen as sync standby because
# Note that standby1 is chosen as sync standby because
# it's stored in the head of WalSnd array which manages
# it's stored in the head of WalSnd array which manages
# all the standbys though they have the same priority.
# all the standbys though they have the same priority.
test_sync_state
(
$node_master
,
qq(standby1|1|sync
test_sync_state
(
$node_master
,
qq(standby1|1|sync
standby2|1|potential
standby2|1|potential
standby3|1|potential)
,
standby3|1|potential)
,
'
asterisk in synchronous_standby_names
',
'
asterisk in synchronous_standby_names
',
...
@@ -100,7 +103,8 @@ $node_standby_3->start;
...
@@ -100,7 +103,8 @@ $node_standby_3->start;
# Specify 2 as the number of sync standbys.
# Specify 2 as the number of sync standbys.
# Check that two standbys are in 'sync' state.
# Check that two standbys are in 'sync' state.
test_sync_state
(
$node_master
,
qq(standby2|2|sync
test_sync_state
(
$node_master
,
qq(standby2|2|sync
standby3|3|sync)
,
standby3|3|sync)
,
'
2 synchronous standbys
',
'
2 synchronous standbys
',
'
2(standby1,standby2,standby3)
');
'
2(standby1,standby2,standby3)
');
...
@@ -118,7 +122,8 @@ $node_standby_4->start;
...
@@ -118,7 +122,8 @@ $node_standby_4->start;
# synchronous_standby_names are considered as sync. Also check that
# synchronous_standby_names are considered as sync. Also check that
# standby3 appearing later represents potential, and standby4 is
# standby3 appearing later represents potential, and standby4 is
# in 'async' state because it's not in the list.
# in 'async' state because it's not in the list.
test_sync_state
(
$node_master
,
qq(standby1|1|sync
test_sync_state
(
$node_master
,
qq(standby1|1|sync
standby2|2|sync
standby2|2|sync
standby3|3|potential
standby3|3|potential
standby4|0|async)
,
standby4|0|async)
,
...
@@ -127,7 +132,8 @@ standby4|0|async),
...
@@ -127,7 +132,8 @@ standby4|0|async),
# Check that sync_state of each standby is determined correctly
# Check that sync_state of each standby is determined correctly
# when num_sync exceeds the number of names of potential sync standbys
# when num_sync exceeds the number of names of potential sync standbys
# specified in synchronous_standby_names.
# specified in synchronous_standby_names.
test_sync_state
(
$node_master
,
qq(standby1|0|async
test_sync_state
(
$node_master
,
qq(standby1|0|async
standby2|4|sync
standby2|4|sync
standby3|3|sync
standby3|3|sync
standby4|1|sync)
,
standby4|1|sync)
,
...
@@ -138,7 +144,8 @@ standby4|1|sync),
...
@@ -138,7 +144,8 @@ standby4|1|sync),
# but does not make sense in most cases. Check that sync_state is
# but does not make sense in most cases. Check that sync_state is
# chosen properly even in case of that setting.
# chosen properly even in case of that setting.
# The priority of standby2 should be 2 because it matches * first.
# The priority of standby2 should be 2 because it matches * first.
test_sync_state
(
$node_master
,
qq(standby1|1|sync
test_sync_state
(
$node_master
,
qq(standby1|1|sync
standby2|2|sync
standby2|2|sync
standby3|2|potential
standby3|2|potential
standby4|2|potential)
,
standby4|2|potential)
,
...
@@ -147,7 +154,8 @@ standby4|2|potential),
...
@@ -147,7 +154,8 @@ standby4|2|potential),
# Check that the setting of '2(*)' chooses standby2 and standby3 that are stored
# Check that the setting of '2(*)' chooses standby2 and standby3 that are stored
# earlier in WalSnd array as sync standbys.
# earlier in WalSnd array as sync standbys.
test_sync_state
(
$node_master
,
qq(standby1|1|potential
test_sync_state
(
$node_master
,
qq(standby1|1|potential
standby2|1|sync
standby2|1|sync
standby3|1|sync
standby3|1|sync
standby4|1|potential)
,
standby4|1|potential)
,
...
@@ -159,7 +167,8 @@ $node_standby_3->stop;
...
@@ -159,7 +167,8 @@ $node_standby_3->stop;
# Check that the state of standby1 stored earlier in WalSnd array than
# Check that the state of standby1 stored earlier in WalSnd array than
# standby4 is transited from potential to sync.
# standby4 is transited from potential to sync.
test_sync_state
(
$node_master
,
qq(standby1|1|sync
test_sync_state
(
$node_master
,
qq(standby1|1|sync
standby2|1|sync
standby2|1|sync
standby4|1|potential)
,
standby4|1|potential)
,
'
potential standby found earlier in array is promoted to sync
');
'
potential standby found earlier in array is promoted to sync
');
src/tools/copyright.pl
View file @
3be0a62f
src/tools/git_changelog
View file @
3be0a62f
...
@@ -374,7 +374,8 @@ sub output_details
...
@@ -374,7 +374,8 @@ sub output_details
{
{
$item
->
{'
message
'}
=~
m/^\s*(.*)/
;
$item
->
{'
message
'}
=~
m/^\s*(.*)/
;
output_str
("
%s [%s] %s
\n
",
output_str
(
"
%s [%s] %s
\n
",
substr
(
$c
->
{'
date
'},
0
,
10
),
substr
(
$c
->
{'
date
'},
0
,
10
),
substr
(
$c
->
{'
commit
'},
0
,
9
),
substr
(
$c
->
{'
commit
'},
0
,
9
),
substr
(
$1
,
0
,
56
));
substr
(
$1
,
0
,
56
));
...
@@ -385,8 +386,7 @@ sub output_details
...
@@ -385,8 +386,7 @@ sub output_details
if
(
!
$master_only
);
if
(
!
$master_only
);
output_str
("
Release: %s
",
$c
->
{'
last_tag
'})
output_str
("
Release: %s
",
$c
->
{'
last_tag
'})
if
(
defined
$c
->
{'
last_tag
'});
if
(
defined
$c
->
{'
last_tag
'});
output_str
("
[%s] %s
\n
",
output_str
("
[%s] %s
\n
",
substr
(
$c
->
{'
commit
'},
0
,
9
),
substr
(
$c
->
{'
commit
'},
0
,
9
),
$c
->
{'
date
'});
$c
->
{'
date
'});
}
}
}
}
...
...
src/tools/msvc/Install.pm
View file @
3be0a62f
...
@@ -582,7 +582,8 @@ sub CopyIncludeFiles
...
@@ -582,7 +582,8 @@ sub CopyIncludeFiles
'Public headers',
$target
. '/include/',
'Public headers',
$target
. '/include/',
'src/include/', 'postgres_ext.h',
'src/include/', 'postgres_ext.h',
'pg_config.h', 'pg_config_ext.h',
'pg_config.h', 'pg_config_ext.h',
'pg_config_os.h', 'dynloader.h', 'pg_config_manual.h');
'pg_config_os.h', 'dynloader.h',
'pg_config_manual.h');
lcopy('src/include/libpq/libpq-fs.h',
$target
. '/include/libpq/')
lcopy('src/include/libpq/libpq-fs.h',
$target
. '/include/libpq/')
|| croak 'Could not copy libpq-fs.h';
|| croak 'Could not copy libpq-fs.h';
...
...
src/tools/msvc/Mkvcbuild.pm
View file @
3be0a62f
...
@@ -41,9 +41,12 @@ my $contrib_extrasource = {
...
@@ -41,9 +41,12 @@ my $contrib_extrasource = {
'
cube
'
=>
[
'
contrib/cube/cubescan.l
',
'
contrib/cube/cubeparse.y
'
],
'
cube
'
=>
[
'
contrib/cube/cubescan.l
',
'
contrib/cube/cubeparse.y
'
],
'
seg
'
=>
[
'
contrib/seg/segscan.l
',
'
contrib/seg/segparse.y
'
],
};
'
seg
'
=>
[
'
contrib/seg/segscan.l
',
'
contrib/seg/segparse.y
'
],
};
my
@contrib_excludes
=
(
my
@contrib_excludes
=
(
'
commit_ts
',
'
hstore_plperl
',
'
hstore_plpython
',
'
intagg
',
'
commit_ts
',
'
hstore_plperl
',
'
ltree_plpython
',
'
pgcrypto
',
'
sepgsql
',
'
brin
',
'
hstore_plpython
',
'
intagg
',
'
test_extensions
',
'
test_pg_dump
',
'
snapshot_too_old
');
'
ltree_plpython
',
'
pgcrypto
',
'
sepgsql
',
'
brin
',
'
test_extensions
',
'
test_pg_dump
',
'
snapshot_too_old
');
# Set of variables for frontend modules
# Set of variables for frontend modules
my
$frontend_defines
=
{
'
initdb
'
=>
'
FRONTEND
'
};
my
$frontend_defines
=
{
'
initdb
'
=>
'
FRONTEND
'
};
...
@@ -63,9 +66,9 @@ my $frontend_extralibs = {
...
@@ -63,9 +66,9 @@ my $frontend_extralibs = {
'
psql
'
=>
['
ws2_32.lib
']
};
'
psql
'
=>
['
ws2_32.lib
']
};
my
$frontend_extraincludes
=
{
my
$frontend_extraincludes
=
{
'
initdb
'
=>
['
src/timezone
'],
'
initdb
'
=>
['
src/timezone
'],
'
psql
'
=>
[
'
src/backend
'
]
};
'
psql
'
=>
[
'
src/backend
'
]
};
my
$frontend_extrasource
=
{
my
$frontend_extrasource
=
{
'
psql
'
=>
[
'
src/bin/psql/psqlscanslash.l
'
],
'
psql
'
=>
[
'
src/bin/psql/psqlscanslash.l
'
],
'
pgbench
'
=>
'
pgbench
'
=>
[
'
src/bin/pgbench/exprscan.l
',
'
src/bin/pgbench/exprparse.y
'
]
};
[
'
src/bin/pgbench/exprscan.l
',
'
src/bin/pgbench/exprparse.y
'
]
};
my
@frontend_excludes
=
(
my
@frontend_excludes
=
(
...
@@ -155,8 +158,10 @@ sub mkvcbuild
...
@@ -155,8 +158,10 @@ sub mkvcbuild
$postgres
->
AddFiles
('
src/backend/bootstrap
',
'
bootscanner.l
',
$postgres
->
AddFiles
('
src/backend/bootstrap
',
'
bootscanner.l
',
'
bootparse.y
');
'
bootparse.y
');
$postgres
->
AddFiles
('
src/backend/utils/misc
',
'
guc-file.l
');
$postgres
->
AddFiles
('
src/backend/utils/misc
',
'
guc-file.l
');
$postgres
->
AddFiles
('
src/backend/replication
',
'
repl_scanner.l
',
$postgres
->
AddFiles
(
'
repl_gram.y
',
'
syncrep_scanner.l
',
'
syncrep_gram.y
');
'
src/backend/replication
',
'
repl_scanner.l
',
'
repl_gram.y
',
'
syncrep_scanner.l
',
'
syncrep_gram.y
');
$postgres
->
AddDefine
('
BUILDING_DLL
');
$postgres
->
AddDefine
('
BUILDING_DLL
');
$postgres
->
AddLibrary
('
secur32.lib
');
$postgres
->
AddLibrary
('
secur32.lib
');
$postgres
->
AddLibrary
('
ws2_32.lib
');
$postgres
->
AddLibrary
('
ws2_32.lib
');
...
@@ -625,8 +630,7 @@ sub mkvcbuild
...
@@ -625,8 +630,7 @@ sub mkvcbuild
}
}
}
}
$proj
->
AddIncludeDir
('
src/interfaces/libpq
');
$proj
->
AddIncludeDir
('
src/interfaces/libpq
');
$proj
->
AddReference
(
$libpq
,
$libpgfeutils
,
$libpgcommon
,
$proj
->
AddReference
(
$libpq
,
$libpgfeutils
,
$libpgcommon
,
$libpgport
);
$libpgport
);
$proj
->
AddDirResourceFile
('
src/bin/scripts
');
$proj
->
AddDirResourceFile
('
src/bin/scripts
');
$proj
->
AddLibrary
('
ws2_32.lib
');
$proj
->
AddLibrary
('
ws2_32.lib
');
}
}
...
...
src/tools/msvc/Solution.pm
View file @
3be0a62f
...
@@ -286,7 +286,8 @@ s{PG_VERSION_STR "[^"]+"}{__STRINGIFY(x) #x\n#define __STRINGIFY2(z) __STRINGIFY
...
@@ -286,7 +286,8 @@ s{PG_VERSION_STR "[^"]+"}{__STRINGIFY(x) #x\n#define __STRINGIFY2(z) __STRINGIFY
}
}
if
(
IsNewer
(
if
(
IsNewer
(
'
src/include/storage/lwlocknames.h
',
'
src/backend/storage/lmgr/lwlocknames.txt
'))
'
src/include/storage/lwlocknames.h
',
'
src/backend/storage/lmgr/lwlocknames.txt
'))
{
{
print
"
Generating lwlocknames.c and lwlocknames.h...
\n
";
print
"
Generating lwlocknames.c and lwlocknames.h...
\n
";
chdir
('
src/backend/storage/lmgr
');
chdir
('
src/backend/storage/lmgr
');
...
@@ -297,13 +298,13 @@ s{PG_VERSION_STR "[^"]+"}{__STRINGIFY(x) #x\n#define __STRINGIFY2(z) __STRINGIFY
...
@@ -297,13 +298,13 @@ s{PG_VERSION_STR "[^"]+"}{__STRINGIFY(x) #x\n#define __STRINGIFY2(z) __STRINGIFY
'
src/include/storage/lwlocknames.h
',
'
src/include/storage/lwlocknames.h
',
'
src/backend/storage/lmgr/lwlocknames.h
'))
'
src/backend/storage/lmgr/lwlocknames.h
'))
{
{
copyFile
('
src/backend/storage/lmgr/lwlocknames.h
',
copyFile
(
'
src/backend/storage/lmgr/lwlocknames.h
',
'
src/include/storage/lwlocknames.h
');
'
src/include/storage/lwlocknames.h
');
}
}
if
(
IsNewer
(
if
(
IsNewer
(
'
src/include/dynloader.h
',
'
src/include/dynloader.h
',
'
src/backend/port/dynloader/win32.h
'))
'
src/backend/port/dynloader/win32.h
'))
{
{
copyFile
('
src/backend/port/dynloader/win32.h
',
copyFile
('
src/backend/port/dynloader/win32.h
',
'
src/include/dynloader.h
');
'
src/include/dynloader.h
');
...
@@ -352,8 +353,7 @@ s{PG_VERSION_STR "[^"]+"}{__STRINGIFY(x) #x\n#define __STRINGIFY2(z) __STRINGIFY
...
@@ -352,8 +353,7 @@ s{PG_VERSION_STR "[^"]+"}{__STRINGIFY(x) #x\n#define __STRINGIFY2(z) __STRINGIFY
if
(
$self
->
{
options
}
->
{
tcl
}
if
(
$self
->
{
options
}
->
{
tcl
}
&&
IsNewer
(
&&
IsNewer
(
'
src/pl/tcl/pltclerrcodes.h
',
'
src/pl/tcl/pltclerrcodes.h
',
'
src/backend/utils/errcodes.txt
'))
'
src/backend/utils/errcodes.txt
'))
{
{
print
"
Generating pltclerrcodes.h...
\n
";
print
"
Generating pltclerrcodes.h...
\n
";
system
(
system
(
...
...
src/tools/msvc/build.pl
View file @
3be0a62f
...
@@ -53,7 +53,8 @@ elsif (uc($ARGV[0]) ne "RELEASE")
...
@@ -53,7 +53,8 @@ elsif (uc($ARGV[0]) ne "RELEASE")
if
(
$buildwhat
and
$vcver
>=
10.00
)
if
(
$buildwhat
and
$vcver
>=
10.00
)
{
{
system
(
system
(
"
msbuild
$buildwhat
.vcxproj /verbosity:normal /p:Configuration=
$bconf
");
"
msbuild
$buildwhat
.vcxproj /verbosity:normal /p:Configuration=
$bconf
"
);
}
}
elsif
(
$buildwhat
)
elsif
(
$buildwhat
)
{
{
...
...
src/tools/msvc/config_default.pl
View file @
3be0a62f
src/tools/msvc/pgflex.pl
View file @
3be0a62f
...
@@ -16,8 +16,8 @@ my ($flexver) = `flex -V`; # grab first line
...
@@ -16,8 +16,8 @@ my ($flexver) = `flex -V`; # grab first line
$flexver
=
(
split
(
/\s+/
,
$flexver
))[
1
];
$flexver
=
(
split
(
/\s+/
,
$flexver
))[
1
];
$flexver
=~
s/[^0-9.]//g
;
$flexver
=~
s/[^0-9.]//g
;
my
@verparts
=
split
(
/\./
,
$flexver
);
my
@verparts
=
split
(
/\./
,
$flexver
);
unless
(
$verparts
[
0
]
==
2
&&
unless
(
$verparts
[
0
]
==
2
(
$verparts
[
1
]
>
5
||
(
$verparts
[
1
]
==
5
&&
$verparts
[
2
]
>=
31
)))
&&
(
$verparts
[
1
]
>
5
||
(
$verparts
[
1
]
==
5
&&
$verparts
[
2
]
>=
31
)))
{
{
print
"
WARNING! Flex install not found, or unsupported Flex version.
\n
";
print
"
WARNING! Flex install not found, or unsupported Flex version.
\n
";
print
"
echo Attempting to build without.
\n
";
print
"
echo Attempting to build without.
\n
";
...
...
src/tools/msvc/vcregress.pl
View file @
3be0a62f
...
@@ -184,7 +184,7 @@ sub tap_check
...
@@ -184,7 +184,7 @@ sub tap_check
my
$dir
=
shift
;
my
$dir
=
shift
;
chdir
$dir
;
chdir
$dir
;
my
@args
=
(
"
prove
",
"
--verbose
",
"
t/*.pl
");
my
@args
=
("
prove
",
"
--verbose
",
"
t/*.pl
");
# adjust the environment for just this test
# adjust the environment for just this test
local
%
ENV
=
%
ENV
;
local
%
ENV
=
%
ENV
;
...
@@ -332,6 +332,7 @@ sub contribcheck
...
@@ -332,6 +332,7 @@ sub contribcheck
my
$mstat
=
0
;
my
$mstat
=
0
;
foreach
my
$module
(
glob
("
*
"))
foreach
my
$module
(
glob
("
*
"))
{
{
# these configuration-based exclusions must match Install.pm
# these configuration-based exclusions must match Install.pm
next
if
(
$module
eq
"
uuid-ossp
"
&&
!
defined
(
$config
->
{
uuid
}));
next
if
(
$module
eq
"
uuid-ossp
"
&&
!
defined
(
$config
->
{
uuid
}));
next
if
(
$module
eq
"
sslinfo
"
&&
!
defined
(
$config
->
{
openssl
}));
next
if
(
$module
eq
"
sslinfo
"
&&
!
defined
(
$config
->
{
openssl
}));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment