# Wait for standby to catch up
my $applname = $node_standby->name;
my $caughtup_query =
-"SELECT pg_current_wal_lsn() <= write_lsn FROM pg_stat_replication WHERE application_name = '$applname';";
+ "SELECT pg_current_wal_lsn() <= write_lsn FROM pg_stat_replication WHERE application_name = '$applname';";
$node_master->poll_query_until('postgres', $caughtup_query)
or die "Timed out while waiting for standby 1 to catch up";
$node_master->safe_psql("postgres", "CREATE EXTENSION bloom;");
$node_master->safe_psql("postgres", "CREATE TABLE tst (i int4, t text);");
$node_master->safe_psql("postgres",
-"INSERT INTO tst SELECT i%10, substr(md5(i::text), 1, 1) FROM generate_series(1,100000) i;"
+ "INSERT INTO tst SELECT i%10, substr(md5(i::text), 1, 1) FROM generate_series(1,100000) i;"
);
$node_master->safe_psql("postgres",
"CREATE INDEX bloomidx ON tst USING bloom (i, t) WITH (col1 = 3);");
test_index_replay("vacuum $i");
my ($start, $end) = (100001 + ($i - 1) * 10000, 100000 + $i * 10000);
$node_master->safe_psql("postgres",
-"INSERT INTO tst SELECT i%10, substr(md5(i::text), 1, 1) FROM generate_series($start,$end) i;"
+ "INSERT INTO tst SELECT i%10, substr(md5(i::text), 1, 1) FROM generate_series($start,$end) i;"
);
test_index_replay("insert $i");
}
if ($kwstring !~ /^[a-z_]+$/)
{
error
-"'$kwstring' is not a valid keyword string, must be all lower-case ASCII chars";
+ "'$kwstring' is not a valid keyword string, must be all lower-case ASCII chars";
}
# Check that the keyword name is valid: all upper-case ASCII chars
if ($kwname !~ /^[A-Z_]+$/)
{
error
-"'$kwname' is not a valid keyword name, must be all upper-case ASCII chars";
+ "'$kwname' is not a valid keyword name, must be all upper-case ASCII chars";
}
# Check that the keyword string matches keyword name
if ($bare_kwname ne uc($kwstring))
{
error
-"keyword name '$kwname' doesn't match keyword string '$kwstring'";
+ "keyword name '$kwname' doesn't match keyword string '$kwstring'";
}
# Check that the keyword is present in the grammar
open my $c, '>', $ctmp or die "Could not open $ctmp: $!";
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 "/* there is deliberately not an #ifndef LWLOCKNAMES_H here */\n\n";
print $c $autogen, "\n";
# s/([^,)]\{1,\}, [^,)]\{1,\}, [^,)]\{1,\}, [^,)]\{1,\})/(INT1, INT2, INT3, INT4)/
{
$s =
-s /\([^,)]+, [^,)]+, [^,)]+, [^,)]+\)/(INT1, INT2, INT3, INT4)/s;
+ s /\([^,)]+, [^,)]+, [^,)]+, [^,)]+\)/(INT1, INT2, INT3, INT4)/s;
$CondReg ||= $s;
}
# s/([^,)]\{1,\}, [^,)]\{1,\}, [^,)]\{1,\}, [^,)]\{1,\}, [^,)]\{1,\})/(INT1, INT2, INT3, INT4, INT5)/
{
$s =
-s /\([^,)]+, [^,)]+, [^,)]+, [^,)]+, [^,)]+\)/(INT1, INT2, INT3, INT4, INT5)/s;
+ s /\([^,)]+, [^,)]+, [^,)]+, [^,)]+, [^,)]+\)/(INT1, INT2, INT3, INT4, INT5)/s;
$CondReg ||= $s;
}
# s/([^,)]\{1,\}, [^,)]\{1,\}, [^,)]\{1,\}, [^,)]\{1,\}, [^,)]\{1,\}, [^,)]\{1,\})/(INT1, INT2, INT3, INT4, INT5, INT6)/
{
$s =
-s /\([^,)]+, [^,)]+, [^,)]+, [^,)]+, [^,)]+, [^,)]+\)/(INT1, INT2, INT3, INT4, INT5, INT6)/s;
+ s /\([^,)]+, [^,)]+, [^,)]+, [^,)]+, [^,)]+, [^,)]+\)/(INT1, INT2, INT3, INT4, INT5, INT6)/s;
$CondReg ||= $s;
}
# s/([^,)]\{1,\}, [^,)]\{1,\}, [^,)]\{1,\}, [^,)]\{1,\}, [^,)]\{1,\}, [^,)]\{1,\}, [^,)]\{1,\})/(INT1, INT2, INT3, INT4, INT5, INT6, INT7)/
{
$s =
-s /\([^,)]+, [^,)]+, [^,)]+, [^,)]+, [^,)]+, [^,)]+, [^,)]+\)/(INT1, INT2, INT3, INT4, INT5, INT6, INT7)/s;
+ s /\([^,)]+, [^,)]+, [^,)]+, [^,)]+, [^,)]+, [^,)]+, [^,)]+\)/(INT1, INT2, INT3, INT4, INT5, INT6, INT7)/s;
$CondReg ||= $s;
}
# s/([^,)]\{1,\}, [^,)]\{1,\}, [^,)]\{1,\}, [^,)]\{1,\}, [^,)]\{1,\}, [^,)]\{1,\}, [^,)]\{1,\}, [^,)]\{1,\})/(INT1, INT2, INT3, INT4, INT5, INT6, INT7, INT8)/
{
$s =
-s /\([^,)]+, [^,)]+, [^,)]+, [^,)]+, [^,)]+, [^,)]+, [^,)]+, [^,)]+\)/(INT1, INT2, INT3, INT4, INT5, INT6, INT7, INT8)/s;
+ s /\([^,)]+, [^,)]+, [^,)]+, [^,)]+, [^,)]+, [^,)]+, [^,)]+, [^,)]+\)/(INT1, INT2, INT3, INT4, INT5, INT6, INT7, INT8)/s;
$CondReg ||= $s;
}
or die "Could not open $tabfile$tmpext: $!";
print $ofh
-qq|/*-------------------------------------------------------------------------
+ qq|/*-------------------------------------------------------------------------
*
* fmgroids.h
* Macros that define the OIDs of built-in functions.
|;
print $pfh
-qq|/*-------------------------------------------------------------------------
+ qq|/*-------------------------------------------------------------------------
*
* fmgrprotos.h
* Prototypes for built-in functions.
|;
print $tfh
-qq|/*-------------------------------------------------------------------------
+ qq|/*-------------------------------------------------------------------------
*
* fmgrtab.c
* The function manager's table of internal functions.
foreach my $s (sort { $a->{oid} <=> $b->{oid} } @fmgr)
{
print $tfh
-" { $s->{oid}, \"$s->{prosrc}\", $s->{nargs}, $bmap{$s->{strict}}, $bmap{$s->{retset}}, $s->{prosrc} }";
+ " { $s->{oid}, \"$s->{prosrc}\", $s->{nargs}, $bmap{$s->{strict}}, $bmap{$s->{retset}}, $s->{prosrc} }";
$fmgr_builtin_oid_index[ $s->{oid} ] = $fmgr_count++;
printf $out "\n/* Combined character map */\n";
printf $out
-"static const pg_utf_to_local_combined ULmap${charset}_combined[ %d ] = {",
+ "static const pg_utf_to_local_combined ULmap${charset}_combined[ %d ] = {",
scalar(@$table);
my $first = 1;
foreach my $i (sort { $a->{utf8} <=> $b->{utf8} } @$table)
printf $out "\n/* Combined character map */\n";
printf $out
-"static const pg_local_to_utf_combined LUmap${charset}_combined[ %d ] = {",
+ "static const pg_local_to_utf_combined LUmap${charset}_combined[ %d ] = {",
scalar(@$table);
my $first = 1;
if ($seg->{overlaid_trail_zeros})
{
printf $out
-" /* $seg->{overlaid_trail_zeros} trailing zero values shared with next segment */\n";
+ " /* $seg->{overlaid_trail_zeros} trailing zero values shared with next segment */\n";
}
}
if (defined $charmap{$src})
{
printf STDERR
-"Error: duplicate source code on %s:%d: 0x%04x => 0x%04x, 0x%04x\n",
+ "Error: duplicate source code on %s:%d: 0x%04x => 0x%04x, 0x%04x\n",
$c->{f}, $c->{l}, $src, $charmap{$src}, $dst;
exit;
}
is( $node->safe_psql(
'postgres',
-q{SELECT slot_name FROM pg_replication_slots WHERE slot_name = 'slot0'}),
+ q{SELECT slot_name FROM pg_replication_slots WHERE slot_name = 'slot0'}
+ ),
'slot0',
'replication slot was created');
isnt(
$node->safe_psql(
'postgres',
-q{SELECT restart_lsn FROM pg_replication_slots WHERE slot_name = 'slot0'}),
+ q{SELECT restart_lsn FROM pg_replication_slots WHERE slot_name = 'slot0'}
+ ),
'',
'restart LSN of new slot is not null');
# create tables to corrupt and get their relfilenodes
my $file_corrupt1 = $node->safe_psql('postgres',
-q{SELECT a INTO corrupt1 FROM generate_series(1,10000) AS a; ALTER TABLE corrupt1 SET (autovacuum_enabled=false); SELECT pg_relation_filepath('corrupt1')}
+ q{SELECT a INTO corrupt1 FROM generate_series(1,10000) AS a; ALTER TABLE corrupt1 SET (autovacuum_enabled=false); SELECT pg_relation_filepath('corrupt1')}
);
my $file_corrupt2 = $node->safe_psql('postgres',
-q{SELECT b INTO corrupt2 FROM generate_series(1,2) AS b; ALTER TABLE corrupt2 SET (autovacuum_enabled=false); SELECT pg_relation_filepath('corrupt2')}
+ q{SELECT b INTO corrupt2 FROM generate_series(1,2) AS b; ALTER TABLE corrupt2 SET (autovacuum_enabled=false); SELECT pg_relation_filepath('corrupt2')}
);
# set page header and block sizes
command_checks_all(
[ 'pg_controldata', $node->data_dir ],
0,
- [
-qr/WARNING: Calculated CRC checksum does not match value stored in file/,
+ [ qr/WARNING: Calculated CRC checksum does not match value stored in file/,
qr/WARNING: invalid WAL segment size/ ],
[qr/^$/],
'pg_controldata with corrupted pg_control');
command_fails_like(
[ 'pg_dump', '-s', '-a' ],
-qr/\Qpg_dump: options -s\/--schema-only and -a\/--data-only cannot be used together\E/,
-'pg_dump: options -s/--schema-only and -a/--data-only cannot be used together'
+ qr/\Qpg_dump: options -s\/--schema-only and -a\/--data-only cannot be used together\E/,
+ 'pg_dump: options -s/--schema-only and -a/--data-only cannot be used together'
);
command_fails_like(
[ 'pg_restore', '-s', '-a' ],
-qr/\Qpg_restore: options -s\/--schema-only and -a\/--data-only cannot be used together\E/,
-'pg_restore: options -s/--schema-only and -a/--data-only cannot be used together'
+ qr/\Qpg_restore: options -s\/--schema-only and -a\/--data-only cannot be used together\E/,
+ 'pg_restore: options -s/--schema-only and -a/--data-only cannot be used together'
);
command_fails_like(
[ 'pg_restore', '-d', 'xxx', '-f', 'xxx' ],
-qr/\Qpg_restore: options -d\/--dbname and -f\/--file cannot be used together\E/,
+ qr/\Qpg_restore: options -d\/--dbname and -f\/--file cannot be used together\E/,
'pg_restore: options -d/--dbname and -f/--file cannot be used together');
command_fails_like(
[ 'pg_dump', '-c', '-a' ],
-qr/\Qpg_dump: options -c\/--clean and -a\/--data-only cannot be used together\E/,
+ qr/\Qpg_dump: options -c\/--clean and -a\/--data-only cannot be used together\E/,
'pg_dump: options -c/--clean and -a/--data-only cannot be used together');
command_fails_like(
[ 'pg_restore', '-c', '-a' ],
-qr/\Qpg_restore: options -c\/--clean and -a\/--data-only cannot be used together\E/,
-'pg_restore: options -c/--clean and -a/--data-only cannot be used together');
+ qr/\Qpg_restore: options -c\/--clean and -a\/--data-only cannot be used together\E/,
+ 'pg_restore: options -c/--clean and -a/--data-only cannot be used together'
+);
command_fails_like(
[ 'pg_dump', '--inserts', '-o' ],
-qr/\Qpg_dump: options --inserts\/--column-inserts and -o\/--oids cannot be used together\E/,
-'pg_dump: options --inserts/--column-inserts and -o/--oids cannot be used together'
+ qr/\Qpg_dump: options --inserts\/--column-inserts and -o\/--oids cannot be used together\E/,
+ 'pg_dump: options --inserts/--column-inserts and -o/--oids cannot be used together'
);
command_fails_like(
command_fails_like(
[ 'pg_restore', '--single-transaction', '-j3' ],
-qr/\Qpg_restore: cannot specify both --single-transaction and multiple jobs\E/,
+ qr/\Qpg_restore: cannot specify both --single-transaction and multiple jobs\E/,
'pg_restore: cannot specify both --single-transaction and multiple jobs');
command_fails_like(
# pg_dumpall command-line argument checks
command_fails_like(
[ 'pg_dumpall', '-g', '-r' ],
-qr/\Qpg_dumpall: options -g\/--globals-only and -r\/--roles-only cannot be used together\E/,
-'pg_dumpall: options -g/--globals-only and -r/--roles-only cannot be used together'
+ qr/\Qpg_dumpall: options -g\/--globals-only and -r\/--roles-only cannot be used together\E/,
+ 'pg_dumpall: options -g/--globals-only and -r/--roles-only cannot be used together'
);
command_fails_like(
[ 'pg_dumpall', '-g', '-t' ],
-qr/\Qpg_dumpall: options -g\/--globals-only and -t\/--tablespaces-only cannot be used together\E/,
-'pg_dumpall: options -g/--globals-only and -t/--tablespaces-only cannot be used together'
+ qr/\Qpg_dumpall: options -g\/--globals-only and -t\/--tablespaces-only cannot be used together\E/,
+ 'pg_dumpall: options -g/--globals-only and -t/--tablespaces-only cannot be used together'
);
command_fails_like(
[ 'pg_dumpall', '-r', '-t' ],
-qr/\Qpg_dumpall: options -r\/--roles-only and -t\/--tablespaces-only cannot be used together\E/,
-'pg_dumpall: options -r/--roles-only and -t/--tablespaces-only cannot be used together'
+ qr/\Qpg_dumpall: options -r\/--roles-only and -t\/--tablespaces-only cannot be used together\E/,
+ 'pg_dumpall: options -r/--roles-only and -t/--tablespaces-only cannot be used together'
);
command_fails_like(
'ALTER TABLE ONLY test_table ALTER COLUMN col1 SET STATISTICS 90' => {
create_order => 93,
create_sql =>
-'ALTER TABLE dump_test.test_table ALTER COLUMN col1 SET STATISTICS 90;',
+ 'ALTER TABLE dump_test.test_table ALTER COLUMN col1 SET STATISTICS 90;',
regexp => qr/^
\QALTER TABLE ONLY dump_test.test_table ALTER COLUMN col1 SET STATISTICS 90;\E\n
/xm,
'ALTER TABLE ONLY test_table ALTER COLUMN col2 SET STORAGE' => {
create_order => 94,
create_sql =>
-'ALTER TABLE dump_test.test_table ALTER COLUMN col2 SET STORAGE EXTERNAL;',
+ 'ALTER TABLE dump_test.test_table ALTER COLUMN col2 SET STORAGE EXTERNAL;',
regexp => qr/^
\QALTER TABLE ONLY dump_test.test_table ALTER COLUMN col2 SET STORAGE EXTERNAL;\E\n
/xm,
'ALTER TABLE ONLY test_table ALTER COLUMN col3 SET STORAGE' => {
create_order => 95,
create_sql =>
-'ALTER TABLE dump_test.test_table ALTER COLUMN col3 SET STORAGE MAIN;',
+ 'ALTER TABLE dump_test.test_table ALTER COLUMN col3 SET STORAGE MAIN;',
regexp => qr/^
\QALTER TABLE ONLY dump_test.test_table ALTER COLUMN col3 SET STORAGE MAIN;\E\n
/xm,
'ALTER TABLE ONLY test_table ALTER COLUMN col4 SET n_distinct' => {
create_order => 95,
create_sql =>
-'ALTER TABLE dump_test.test_table ALTER COLUMN col4 SET (n_distinct = 10);',
+ 'ALTER TABLE dump_test.test_table ALTER COLUMN col4 SET (n_distinct = 10);',
regexp => qr/^
\QALTER TABLE ONLY dump_test.test_table ALTER COLUMN col4 SET (n_distinct=10);\E\n
/xm,
exclude_dump_test_schema => 1,
exclude_test_table => 1, }, },
-'ALTER TABLE ONLY dump_test.measurement ATTACH PARTITION measurement_y2006m2'
+ 'ALTER TABLE ONLY dump_test.measurement ATTACH PARTITION measurement_y2006m2'
=> {
regexp => qr/^
\QALTER TABLE ONLY dump_test.measurement ATTACH PARTITION dump_test_second_schema.measurement_y2006m2 \E
'ALTER TABLE test_third_table OWNER TO' => {
regexp =>
-qr/^ALTER TABLE dump_test_second_schema.test_third_table OWNER TO .*;/m,
+ qr/^ALTER TABLE dump_test_second_schema.test_third_table OWNER TO .*;/m,
like => {
%full_runs,
role => 1,
'ALTER TABLE measurement_y2006m2 OWNER TO' => {
regexp =>
-qr/^ALTER TABLE dump_test_second_schema.measurement_y2006m2 OWNER TO .*;/m,
+ qr/^ALTER TABLE dump_test_second_schema.measurement_y2006m2 OWNER TO .*;/m,
like => {
%full_runs,
role => 1,
'ALTER TEXT SEARCH CONFIGURATION alt_ts_conf1 OWNER TO' => {
regexp =>
-qr/^ALTER TEXT SEARCH CONFIGURATION dump_test.alt_ts_conf1 OWNER TO .*;/m,
+ qr/^ALTER TEXT SEARCH CONFIGURATION dump_test.alt_ts_conf1 OWNER TO .*;/m,
like =>
{ %full_runs, %dump_test_schema_runs, section_pre_data => 1, },
unlike => {
'ALTER TEXT SEARCH DICTIONARY alt_ts_dict1 OWNER TO' => {
regexp =>
-qr/^ALTER TEXT SEARCH DICTIONARY dump_test.alt_ts_dict1 OWNER TO .*;/m,
+ qr/^ALTER TEXT SEARCH DICTIONARY dump_test.alt_ts_dict1 OWNER TO .*;/m,
like =>
{ %full_runs, %dump_test_schema_runs, section_pre_data => 1, },
unlike => {
'BLOB create (using lo_from_bytea)' => {
create_order => 50,
create_sql =>
-'SELECT pg_catalog.lo_from_bytea(0, \'\\x310a320a330a340a350a360a370a380a390a\');',
+ 'SELECT pg_catalog.lo_from_bytea(0, \'\\x310a320a330a340a350a360a370a380a390a\');',
regexp => qr/^SELECT pg_catalog\.lo_create\('\d+'\);/m,
like => {
%full_runs,
create_sql => 'COMMENT ON CONVERSION dump_test.test_conversion
IS \'comment on test conversion\';',
regexp =>
-qr/^COMMENT ON CONVERSION dump_test.test_conversion IS 'comment on test conversion';/m,
+ qr/^COMMENT ON CONVERSION dump_test.test_conversion IS 'comment on test conversion';/m,
like =>
{ %full_runs, %dump_test_schema_runs, section_pre_data => 1, },
unlike => { exclude_dump_test_schema => 1, }, },
create_sql => 'COMMENT ON COLLATION test0
IS \'comment on test0 collation\';',
regexp =>
-qr/^COMMENT ON COLLATION public.test0 IS 'comment on test0 collation';/m,
+ qr/^COMMENT ON COLLATION public.test0 IS 'comment on test0 collation';/m,
collation => 1,
like => { %full_runs, section_pre_data => 1, }, },
'COMMENT ON TEXT SEARCH CONFIGURATION dump_test.alt_ts_conf1
IS \'comment on text search configuration\';',
regexp =>
-qr/^COMMENT ON TEXT SEARCH CONFIGURATION dump_test.alt_ts_conf1 IS 'comment on text search configuration';/m,
+ qr/^COMMENT ON TEXT SEARCH CONFIGURATION dump_test.alt_ts_conf1 IS 'comment on text search configuration';/m,
like =>
{ %full_runs, %dump_test_schema_runs, section_pre_data => 1, },
unlike => { exclude_dump_test_schema => 1, }, },
'COMMENT ON TEXT SEARCH DICTIONARY dump_test.alt_ts_dict1
IS \'comment on text search dictionary\';',
regexp =>
-qr/^COMMENT ON TEXT SEARCH DICTIONARY dump_test.alt_ts_dict1 IS 'comment on text search dictionary';/m,
+ qr/^COMMENT ON TEXT SEARCH DICTIONARY dump_test.alt_ts_dict1 IS 'comment on text search dictionary';/m,
like =>
{ %full_runs, %dump_test_schema_runs, section_pre_data => 1, },
unlike => { exclude_dump_test_schema => 1, }, },
create_sql => 'COMMENT ON TEXT SEARCH PARSER dump_test.alt_ts_prs1
IS \'comment on text search parser\';',
regexp =>
-qr/^COMMENT ON TEXT SEARCH PARSER dump_test.alt_ts_prs1 IS 'comment on text search parser';/m,
+ qr/^COMMENT ON TEXT SEARCH PARSER dump_test.alt_ts_prs1 IS 'comment on text search parser';/m,
like =>
{ %full_runs, %dump_test_schema_runs, section_pre_data => 1, },
unlike => { exclude_dump_test_schema => 1, }, },
create_sql => 'COMMENT ON TEXT SEARCH TEMPLATE dump_test.alt_ts_temp1
IS \'comment on text search template\';',
regexp =>
-qr/^COMMENT ON TEXT SEARCH TEMPLATE dump_test.alt_ts_temp1 IS 'comment on text search template';/m,
+ qr/^COMMENT ON TEXT SEARCH TEMPLATE dump_test.alt_ts_temp1 IS 'comment on text search template';/m,
like =>
{ %full_runs, %dump_test_schema_runs, section_pre_data => 1, },
unlike => { exclude_dump_test_schema => 1, }, },
create_sql => 'COMMENT ON TYPE dump_test.textrange
IS \'comment on range type\';',
regexp =>
-qr/^COMMENT ON TYPE dump_test.textrange IS 'comment on range type';/m,
+ qr/^COMMENT ON TYPE dump_test.textrange IS 'comment on range type';/m,
like =>
{ %full_runs, %dump_test_schema_runs, section_pre_data => 1, },
unlike => { exclude_dump_test_schema => 1, }, },
create_sql => 'COMMENT ON TYPE dump_test.undefined
IS \'comment on undefined type\';',
regexp =>
-qr/^COMMENT ON TYPE dump_test.undefined IS 'comment on undefined type';/m,
+ qr/^COMMENT ON TYPE dump_test.undefined IS 'comment on undefined type';/m,
like =>
{ %full_runs, %dump_test_schema_runs, section_pre_data => 1, },
unlike => { exclude_dump_test_schema => 1, }, },
'COPY test_fifth_table' => {
create_order => 54,
create_sql =>
-'INSERT INTO dump_test.test_fifth_table VALUES (NULL, true, false, \'11001\'::bit(5), \'NaN\');',
+ 'INSERT INTO dump_test.test_fifth_table VALUES (NULL, true, false, \'11001\'::bit(5), \'NaN\');',
regexp => qr/^
\QCOPY dump_test.test_fifth_table (col1, col2, col3, col4, col5) FROM stdin;\E
\n\\N\tt\tf\t11001\tNaN\n\\\.\n
'COPY test_table_identity' => {
create_order => 54,
create_sql =>
-'INSERT INTO dump_test.test_table_identity (col2) VALUES (\'test\');',
+ 'INSERT INTO dump_test.test_table_identity (col2) VALUES (\'test\');',
regexp => qr/^
\QCOPY dump_test.test_table_identity (col1, col2) FROM stdin;\E
\n1\ttest\n\\\.\n
'INSERT INTO test_fifth_table' => {
regexp =>
-qr/^\QINSERT INTO dump_test.test_fifth_table (col1, col2, col3, col4, col5) VALUES (NULL, true, false, B'11001', 'NaN');\E/m,
+ qr/^\QINSERT INTO dump_test.test_fifth_table (col1, col2, col3, col4, col5) VALUES (NULL, true, false, B'11001', 'NaN');\E/m,
like => { column_inserts => 1, }, },
'INSERT INTO test_table_identity' => {
regexp =>
-qr/^\QINSERT INTO dump_test.test_table_identity (col1, col2) OVERRIDING SYSTEM VALUE VALUES (1, 'test');\E/m,
+ qr/^\QINSERT INTO dump_test.test_table_identity (col1, col2) OVERRIDING SYSTEM VALUE VALUES (1, 'test');\E/m,
like => { column_inserts => 1, }, },
'CREATE ROLE regress_dump_test_role' => {
'CREATE CAST FOR timestamptz' => {
create_order => 51,
create_sql =>
-'CREATE CAST (timestamptz AS interval) WITH FUNCTION age(timestamptz) AS ASSIGNMENT;',
+ 'CREATE CAST (timestamptz AS interval) WITH FUNCTION age(timestamptz) AS ASSIGNMENT;',
regexp =>
-qr/CREATE CAST \(timestamp with time zone AS interval\) WITH FUNCTION pg_catalog\.age\(timestamp with time zone\) AS ASSIGNMENT;/m,
+ qr/CREATE CAST \(timestamp with time zone AS interval\) WITH FUNCTION pg_catalog\.age\(timestamp with time zone\) AS ASSIGNMENT;/m,
like => { %full_runs, section_pre_data => 1, }, },
'CREATE DATABASE postgres' => {
'CREATE CONVERSION dump_test.test_conversion' => {
create_order => 78,
create_sql =>
-'CREATE DEFAULT CONVERSION dump_test.test_conversion FOR \'LATIN1\' TO \'UTF8\' FROM iso8859_1_to_utf8;',
+ 'CREATE DEFAULT CONVERSION dump_test.test_conversion FOR \'LATIN1\' TO \'UTF8\' FROM iso8859_1_to_utf8;',
regexp =>
-qr/^\QCREATE DEFAULT CONVERSION dump_test.test_conversion FOR 'LATIN1' TO 'UTF8' FROM iso8859_1_to_utf8;\E/xm,
+ qr/^\QCREATE DEFAULT CONVERSION dump_test.test_conversion FOR 'LATIN1' TO 'UTF8' FROM iso8859_1_to_utf8;\E/xm,
like =>
{ %full_runs, %dump_test_schema_runs, section_pre_data => 1, },
unlike => { exclude_dump_test_schema => 1, }, },
'CREATE TEXT SEARCH CONFIGURATION dump_test.alt_ts_conf1' => {
create_order => 80,
create_sql =>
-'CREATE TEXT SEARCH CONFIGURATION dump_test.alt_ts_conf1 (copy=english);',
+ 'CREATE TEXT SEARCH CONFIGURATION dump_test.alt_ts_conf1 (copy=english);',
regexp => qr/^
\QCREATE TEXT SEARCH CONFIGURATION dump_test.alt_ts_conf1 (\E\n
\s+\QPARSER = pg_catalog."default" );\E/xm,
'CREATE TEXT SEARCH TEMPLATE dump_test.alt_ts_temp1' => {
create_order => 81,
create_sql =>
-'CREATE TEXT SEARCH TEMPLATE dump_test.alt_ts_temp1 (lexize=dsimple_lexize);',
+ 'CREATE TEXT SEARCH TEMPLATE dump_test.alt_ts_temp1 (lexize=dsimple_lexize);',
regexp => qr/^
\QCREATE TEXT SEARCH TEMPLATE dump_test.alt_ts_temp1 (\E\n
\s+\QLEXIZE = dsimple_lexize );\E/xm,
'CREATE TEXT SEARCH DICTIONARY dump_test.alt_ts_dict1' => {
create_order => 83,
create_sql =>
-'CREATE TEXT SEARCH DICTIONARY dump_test.alt_ts_dict1 (template=simple);',
+ 'CREATE TEXT SEARCH DICTIONARY dump_test.alt_ts_dict1 (template=simple);',
regexp => qr/^
\QCREATE TEXT SEARCH DICTIONARY dump_test.alt_ts_dict1 (\E\n
\s+\QTEMPLATE = pg_catalog.simple );\E\n
'CREATE FOREIGN TABLE dump_test.foreign_table SERVER s1' => {
create_order => 88,
create_sql =>
-'CREATE FOREIGN TABLE dump_test.foreign_table (c1 int options (column_name \'col1\'))
+ 'CREATE FOREIGN TABLE dump_test.foreign_table (c1 int options (column_name \'col1\'))
SERVER s1 OPTIONS (schema_name \'x1\');',
regexp => qr/
\QCREATE FOREIGN TABLE dump_test.foreign_table (\E\n
'CREATE TRANSFORM FOR int' => {
create_order => 34,
create_sql =>
-'CREATE TRANSFORM FOR int LANGUAGE SQL (FROM SQL WITH FUNCTION varchar_transform(internal), TO SQL WITH FUNCTION int4recv(internal));',
+ 'CREATE TRANSFORM FOR int LANGUAGE SQL (FROM SQL WITH FUNCTION varchar_transform(internal), TO SQL WITH FUNCTION int4recv(internal));',
regexp =>
-qr/CREATE TRANSFORM FOR integer LANGUAGE sql \(FROM SQL WITH FUNCTION pg_catalog\.varchar_transform\(internal\), TO SQL WITH FUNCTION pg_catalog\.int4recv\(internal\)\);/m,
+ qr/CREATE TRANSFORM FOR integer LANGUAGE sql \(FROM SQL WITH FUNCTION pg_catalog\.varchar_transform\(internal\), TO SQL WITH FUNCTION pg_catalog\.int4recv\(internal\)\);/m,
like => { %full_runs, section_pre_data => 1, }, },
'CREATE LANGUAGE pltestlang' => {
catch_all => 'CREATE ... commands',
create_order => 93,
create_sql =>
-'ALTER TABLE dump_test.measurement ADD PRIMARY KEY (city_id, logdate);',
+ 'ALTER TABLE dump_test.measurement ADD PRIMARY KEY (city_id, logdate);',
regexp => qr/^
\QALTER TABLE ONLY dump_test.measurement\E \n^\s+
\QADD CONSTRAINT measurement_pkey PRIMARY KEY (city_id, logdate);\E
'GRANT USAGE ON DOMAIN dump_test.us_postal_code' => {
create_order => 72,
create_sql =>
-'GRANT USAGE ON DOMAIN dump_test.us_postal_code TO regress_dump_test_role;',
+ 'GRANT USAGE ON DOMAIN dump_test.us_postal_code TO regress_dump_test_role;',
regexp => qr/^
\QGRANT ALL ON TYPE dump_test.us_postal_code TO regress_dump_test_role;\E
/xm,
'GRANT USAGE ON TYPE dump_test.textrange - RANGE' => {
create_order => 67,
create_sql =>
-'GRANT USAGE ON TYPE dump_test.textrange TO regress_dump_test_role;',
+ 'GRANT USAGE ON TYPE dump_test.textrange TO regress_dump_test_role;',
regexp => qr/^
\QGRANT ALL ON TYPE dump_test.textrange TO regress_dump_test_role;\E
/xm,
create_sql => 'GRANT SELECT ON TABLE dump_test.test_table
TO regress_dump_test_role;',
regexp =>
-qr/^GRANT SELECT ON TABLE dump_test.test_table TO regress_dump_test_role;/m,
+ qr/^GRANT SELECT ON TABLE dump_test.test_table TO regress_dump_test_role;/m,
like => {
%full_runs,
%dump_test_schema_runs,
TABLE dump_test_second_schema.test_third_table
TO regress_dump_test_role;',
regexp =>
-qr/^GRANT SELECT ON TABLE dump_test_second_schema.test_third_table TO regress_dump_test_role;/m,
+ qr/^GRANT SELECT ON TABLE dump_test_second_schema.test_third_table TO regress_dump_test_role;/m,
like => {
%full_runs,
role => 1,
TABLE dump_test.measurement
TO regress_dump_test_role;',
regexp =>
-qr/^GRANT SELECT ON TABLE dump_test.measurement TO regress_dump_test_role;/m,
+ qr/^GRANT SELECT ON TABLE dump_test.measurement TO regress_dump_test_role;/m,
like =>
{ %full_runs, %dump_test_schema_runs, section_pre_data => 1, },
unlike => {
TABLE dump_test_second_schema.measurement_y2006m2
TO regress_dump_test_role;',
regexp =>
-qr/^GRANT SELECT ON TABLE dump_test_second_schema.measurement_y2006m2 TO regress_dump_test_role;/m,
+ qr/^GRANT SELECT ON TABLE dump_test_second_schema.measurement_y2006m2 TO regress_dump_test_role;/m,
like => {
%full_runs,
role => 1,
command_fails_like(
[ 'pg_dump', '-p', "$port", 'qqq' ],
-qr/\Qpg_dump: [archiver (db)] connection to database "qqq" failed: FATAL: database "qqq" does not exist\E/,
-'pg_dump: [archiver (db)] connection to database "qqq" failed: FATAL: database "qqq" does not exist'
+ qr/\Qpg_dump: [archiver (db)] connection to database "qqq" failed: FATAL: database "qqq" does not exist\E/,
+ 'pg_dump: [archiver (db)] connection to database "qqq" failed: FATAL: database "qqq" does not exist'
);
#########################################
command_fails_like(
[ 'pg_dump', '-p', "$port", '--role=regress_dump_test_role' ],
-qr/\Qpg_dump: [archiver (db)] query failed: ERROR: permission denied for\E/,
+ qr/\Qpg_dump: [archiver (db)] query failed: ERROR: permission denied for\E/,
'pg_dump: [archiver (db)] query failed: ERROR: permission denied for');
#########################################
[ 'pg_resetwal', '-n', $node->data_dir ],
0,
[qr/pg_control version number/],
- [
-qr/pg_resetwal: pg_control exists but is broken or wrong version; ignoring it/
+ [ qr/pg_resetwal: pg_control exists but is broken or wrong version; ignoring it/
],
'processes corrupted pg_control all zeroes');
[ 'pg_resetwal', '-n', $node->data_dir ],
0,
[qr/pg_control version number/],
- [
-qr/\Qpg_resetwal: pg_control specifies invalid WAL segment size (0 bytes); proceed with caution\E/
+ [ qr/\Qpg_resetwal: pg_control specifies invalid WAL segment size (0 bytes); proceed with caution\E/
],
'processes zero WAL segment size');
master_psql(
"INSERT INTO trunc_tbl values ('in master, before promotion')");
master_psql(
-"INSERT INTO tail_tbl SELECT g, 'in master, before promotion: ' || g FROM generate_series(1, 10000) g"
+ "INSERT INTO tail_tbl SELECT g, 'in master, before promotion: ' || g FROM generate_series(1, 10000) g"
);
master_psql('CHECKPOINT');
# Insert enough rows to trunc_tbl to extend the file. pg_rewind should
# truncate it back to the old size.
master_psql(
-"INSERT INTO trunc_tbl SELECT 'in master, after promotion: ' || g FROM generate_series(1, 10000) g"
+ "INSERT INTO trunc_tbl SELECT 'in master, after promotion: ' || g FROM generate_series(1, 10000) g"
);
# Truncate tail_tbl. pg_rewind should copy back the truncated part
"$test_master_datadir/tst_standby_dir/standby_file1",
"$test_master_datadir/tst_standby_dir/standby_file2",
"$test_master_datadir/tst_standby_dir/standby_subdir",
-"$test_master_datadir/tst_standby_dir/standby_subdir/standby_file3" ],
+ "$test_master_datadir/tst_standby_dir/standby_subdir/standby_file3"
+ ],
"file lists match");
RewindTest::clean_rewind_test();
# Again, with all possible options
pgbench(
-'--initialize --init-steps=dtpvg --scale=1 --unlogged-tables --fillfactor=98 --foreign-keys --quiet --tablespace=pg_default --index-tablespace=pg_default',
+ '--initialize --init-steps=dtpvg --scale=1 --unlogged-tables --fillfactor=98 --foreign-keys --quiet --tablespace=pg_default --index-tablespace=pg_default',
0,
[qr{^$}i],
[ qr{dropping old tables},
# Test interaction of --init-steps with legacy step-selection options
pgbench(
-'--initialize --init-steps=dtpvgvv --no-vacuum --foreign-keys --unlogged-tables',
+ '--initialize --init-steps=dtpvgvv --no-vacuum --foreign-keys --unlogged-tables',
0,
[qr{^$}],
[ qr{dropping old tables},
'pgbench tpcb-like');
pgbench(
-'--transactions=20 --client=5 -M extended --builtin=si -C --no-vacuum -s 1',
+ '--transactions=20 --client=5 -M extended --builtin=si -C --no-vacuum -s 1',
0,
[ qr{builtin: simple update},
qr{clients: 5\b},
# test expressions
# command 1..3 and 23 depend on random seed which is used to call srandom.
pgbench(
-'--random-seed=5432 -t 1 -Dfoo=-10.1 -Dbla=false -Di=+3 -Dminint=-9223372036854775808 -Dn=null -Dt=t -Df=of -Dd=1.0',
+ '--random-seed=5432 -t 1 -Dfoo=-10.1 -Dbla=false -Di=+3 -Dminint=-9223372036854775808 -Dn=null -Dt=t -Df=of -Dd=1.0',
0,
[ qr{type: .*/001_pgbench_expressions}, qr{processed: 1/1} ],
[ qr{setting random seed to 5432\b},
# random determinism when seeded
$node->safe_psql('postgres',
-'CREATE UNLOGGED TABLE seeded_random(seed INT8 NOT NULL, rand TEXT NOT NULL, val INTEGER NOT NULL);'
+ 'CREATE UNLOGGED TABLE seeded_random(seed INT8 NOT NULL, rand TEXT NOT NULL, val INTEGER NOT NULL);'
);
# same value to check for determinism
# check that all runs generated the same 4 values
my ($ret, $out, $err) = $node->psql('postgres',
-'SELECT seed, rand, val, COUNT(*) FROM seeded_random GROUP BY seed, rand, val'
+ 'SELECT seed, rand, val, COUNT(*) FROM seeded_random GROUP BY seed, rand, val'
);
ok($ret == 0, "psql seeded_random count ok");
my $n = '001_pgbench_error_' . $name;
$n =~ s/ /_/g;
pgbench(
-'-n -t 1 -Dfoo=bla -Dnull=null -Dtrue=true -Done=1 -Dzero=0.0 -Dbadtrue=trueXXX -M prepared',
+ '-n -t 1 -Dfoo=bla -Dnull=null -Dtrue=true -Done=1 -Dzero=0.0 -Dbadtrue=trueXXX -M prepared',
$status,
[ $status ? qr{^$} : qr{processed: 0/1} ],
$re,
# with sampling rate
pgbench(
-"-n -S -t 50 -c 2 --log --log-prefix=$bdir/001_pgbench_log_2 --sampling-rate=0.5",
+ "-n -S -t 50 -c 2 --log --log-prefix=$bdir/001_pgbench_log_2 --sampling-rate=0.5",
0,
[ qr{select only}, qr{processed: 100/100} ],
[qr{^$}],
[ qr{unrecognized initialization step}, qr{allowed steps are} ] ],
[ 'bad random seed',
'--random-seed=one',
- [
-qr{unrecognized random seed option "one": expecting an unsigned integer, "time" or "rand"},
+ [ qr{unrecognized random seed option "one": expecting an unsigned integer, "time" or "rand"},
qr{error while setting random seed from --random-seed option} ] ],
# loging sub-options
'fails with nonexistent table');
$node->safe_psql('postgres',
-'CREATE TABLE test1 (a int); CREATE INDEX test1x ON test1 (a); CLUSTER test1 USING test1x'
+ 'CREATE TABLE test1 (a int); CREATE INDEX test1x ON test1 (a); CLUSTER test1 USING test1x'
);
$node->issues_sql_like(
[ 'clusterdb', '-t', 'test1' ],
$node->issues_sql_like(
[ 'createuser', 'regress_user1' ],
-qr/statement: CREATE ROLE regress_user1 NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT LOGIN;/,
+ qr/statement: CREATE ROLE regress_user1 NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT LOGIN;/,
'SQL CREATE USER run');
$node->issues_sql_like(
[ 'createuser', '-L', 'regress_role1' ],
-qr/statement: CREATE ROLE regress_role1 NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT NOLOGIN;/,
+ qr/statement: CREATE ROLE regress_role1 NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT NOLOGIN;/,
'create a non-login role');
$node->issues_sql_like(
[ 'createuser', '-r', 'regress_user2' ],
-qr/statement: CREATE ROLE regress_user2 NOSUPERUSER NOCREATEDB CREATEROLE INHERIT LOGIN;/,
+ qr/statement: CREATE ROLE regress_user2 NOSUPERUSER NOCREATEDB CREATEROLE INHERIT LOGIN;/,
'create a CREATEROLE user');
$node->issues_sql_like(
[ 'createuser', '-s', 'regress_user3' ],
-qr/statement: CREATE ROLE regress_user3 SUPERUSER CREATEDB CREATEROLE INHERIT LOGIN;/,
+ qr/statement: CREATE ROLE regress_user3 SUPERUSER CREATEDB CREATEROLE INHERIT LOGIN;/,
'create a superuser');
$node->command_fails([ 'createuser', 'regress_user1' ],
$node->issues_sql_like(
[ 'vacuumdb', '--analyze-in-stages', 'postgres' ],
-qr/.*statement:\ SET\ default_statistics_target=1;\ SET\ vacuum_cost_delay=0;
+ qr/.*statement:\ SET\ default_statistics_target=1;\ SET\ vacuum_cost_delay=0;
.*statement:\ ANALYZE.*
.*statement:\ SET\ default_statistics_target=10;\ RESET\ vacuum_cost_delay;
.*statement:\ ANALYZE.*
$node->issues_sql_like(
[ 'vacuumdb', '--analyze-in-stages', '--all' ],
-qr/.*statement:\ SET\ default_statistics_target=1;\ SET\ vacuum_cost_delay=0;
+ qr/.*statement:\ SET\ default_statistics_target=1;\ SET\ vacuum_cost_delay=0;
.*statement:\ ANALYZE.*
.*statement:\ SET\ default_statistics_target=1;\ SET\ vacuum_cost_delay=0;
.*statement:\ ANALYZE.*
'ExecuteStmtEXECUTEnameexecute_param_clause' =>
'EXECUTE prepared_name execute_param_clause execute_rest',
-'ExecuteStmtCREATEOptTempTABLEcreate_as_targetASEXECUTEnameexecute_param_clause'
+ 'ExecuteStmtCREATEOptTempTABLEcreate_as_targetASEXECUTEnameexecute_param_clause'
=> 'CREATE OptTemp TABLE create_as_target AS EXECUTE prepared_name execute_param_clause',
'PrepareStmtPREPAREnameprep_type_clauseASPreparableStmt' =>
'RETURNING target_list opt_ecpg_into',
'ExecuteStmtEXECUTEnameexecute_param_clause' =>
'EXECUTE prepared_name execute_param_clause execute_rest',
-'ExecuteStmtCREATEOptTempTABLEcreate_as_targetASEXECUTEnameexecute_param_clause'
+ 'ExecuteStmtCREATEOptTempTABLEcreate_as_targetASEXECUTEnameexecute_param_clause'
=> 'CREATE OptTemp TABLE create_as_target AS EXECUTE prepared_name execute_param_clause',
'PrepareStmtPREPAREnameprep_type_clauseASPreparableStmt' =>
'PREPARE prepared_name prep_type_clause AS PreparableStmt',
if ($flds->[0] ne 'create' || $flds->[2] ne 'table')
{
add_to_buffer('rules',
-'mmerror(PARSE_ERROR, ET_WARNING, "unsupported feature will be passed to server");'
+ 'mmerror(PARSE_ERROR, ET_WARNING, "unsupported feature will be passed to server");'
);
}
$feature_not_supported = 0;
# Create 3 roles with different password methods for each one. The same
# password is used for all of them.
$node->safe_psql('postgres',
-"SET password_encryption='scram-sha-256'; CREATE ROLE scram_role LOGIN PASSWORD 'pass';"
+ "SET password_encryption='scram-sha-256'; CREATE ROLE scram_role LOGIN PASSWORD 'pass';"
);
$node->safe_psql('postgres',
-"SET password_encryption='md5'; CREATE ROLE md5_role LOGIN PASSWORD 'pass';");
+ "SET password_encryption='md5'; CREATE ROLE md5_role LOGIN PASSWORD 'pass';"
+);
$ENV{"PGPASSWORD"} = 'pass';
# For "trust" method, all users should be able to connect.
unlink($node->data_dir . '/pg_hba.conf');
$node->append_conf('pg_hba.conf',
-qq{local all all ldap ldapserver=$ldap_server ldapport=$ldap_port ldapprefix="uid=" ldapsuffix=",dc=example,dc=net"}
+ qq{local all all ldap ldapserver=$ldap_server ldapport=$ldap_port ldapprefix="uid=" ldapsuffix=",dc=example,dc=net"}
);
$node->restart;
unlink($node->data_dir . '/pg_hba.conf');
$node->append_conf('pg_hba.conf',
-qq{local all all ldap ldapserver=$ldap_server ldapport=$ldap_port ldapbasedn="$ldap_basedn"}
+ qq{local all all ldap ldapserver=$ldap_server ldapport=$ldap_port ldapbasedn="$ldap_basedn"}
);
$node->restart;
unlink($node->data_dir . '/pg_hba.conf');
$node->append_conf('pg_hba.conf',
-qq{local all all ldap ldapserver=$ldap_server ldapport=$ldap_port ldapbasedn="$ldap_basedn" ldapsearchfilter="(|(uid=\$username)(mail=\$username))"}
+ qq{local all all ldap ldapserver=$ldap_server ldapport=$ldap_port ldapbasedn="$ldap_basedn" ldapsearchfilter="(|(uid=\$username)(mail=\$username))"}
);
$node->restart;
unlink($node->data_dir . '/pg_hba.conf');
$node->append_conf('pg_hba.conf',
-qq{local all all ldap ldapurl="$ldap_url/$ldap_basedn??sub?(|(uid=\$username)(mail=\$username))"}
+ qq{local all all ldap ldapurl="$ldap_url/$ldap_basedn??sub?(|(uid=\$username)(mail=\$username))"}
);
$node->restart;
# override. It might be useful in a case like this.
unlink($node->data_dir . '/pg_hba.conf');
$node->append_conf('pg_hba.conf',
-qq{local all all ldap ldapurl="$ldap_url/$ldap_basedn??sub" ldapsearchfilter="(|(uid=\$username)(mail=\$username))"}
+ qq{local all all ldap ldapurl="$ldap_url/$ldap_basedn??sub" ldapsearchfilter="(|(uid=\$username)(mail=\$username))"}
);
$node->restart;
# note bad ldapprefix with a question mark that triggers a diagnostic message
unlink($node->data_dir . '/pg_hba.conf');
$node->append_conf('pg_hba.conf',
-qq{local all all ldap ldapserver=$ldap_server ldapport=$ldap_port ldapprefix="?uid=" ldapsuffix=""}
+ qq{local all all ldap ldapserver=$ldap_server ldapport=$ldap_port ldapprefix="?uid=" ldapsuffix=""}
);
$node->restart;
# request StartTLS with ldaptls=1
unlink($node->data_dir . '/pg_hba.conf');
$node->append_conf('pg_hba.conf',
-qq{local all all ldap ldapserver=$ldap_server ldapport=$ldap_port ldapbasedn="$ldap_basedn" ldapsearchfilter="(uid=\$username)" ldaptls=1}
+ qq{local all all ldap ldapserver=$ldap_server ldapport=$ldap_port ldapbasedn="$ldap_basedn" ldapsearchfilter="(uid=\$username)" ldaptls=1}
);
$node->restart;
# request LDAPS with ldapscheme=ldaps
unlink($node->data_dir . '/pg_hba.conf');
$node->append_conf('pg_hba.conf',
-qq{local all all ldap ldapserver=$ldap_server ldapscheme=ldaps ldapport=$ldaps_port ldapbasedn="$ldap_basedn" ldapsearchfilter="(uid=\$username)"}
+ qq{local all all ldap ldapserver=$ldap_server ldapscheme=ldaps ldapport=$ldaps_port ldapbasedn="$ldap_basedn" ldapsearchfilter="(uid=\$username)"}
);
$node->restart;
# request LDAPS with ldapurl=ldaps://...
unlink($node->data_dir . '/pg_hba.conf');
$node->append_conf('pg_hba.conf',
-qq{local all all ldap ldapurl="$ldaps_url/$ldap_basedn??sub?(uid=\$username)"}
+ qq{local all all ldap ldapurl="$ldaps_url/$ldap_basedn??sub?(uid=\$username)"}
);
$node->restart;
# bad combination of LDAPS and StartTLS
unlink($node->data_dir . '/pg_hba.conf');
$node->append_conf('pg_hba.conf',
-qq{local all all ldap ldapurl="$ldaps_url/$ldap_basedn??sub?(uid=\$username)" ldaptls=1}
+ qq{local all all ldap ldapurl="$ldaps_url/$ldap_basedn??sub?(uid=\$username)" ldaptls=1}
);
$node->restart;
'
);
my $count = $node->safe_psql('postgres',
-"select count(*) from brin_page_items(get_raw_page('brin_wi_idx', 2), 'brin_wi_idx'::regclass)"
+ "select count(*) from brin_page_items(get_raw_page('brin_wi_idx', 2), 'brin_wi_idx'::regclass)"
);
is($count, '1', "initial index state is correct");
$node->poll_query_until(
'postgres',
-"select count(*) > 1 from brin_page_items(get_raw_page('brin_wi_idx', 2), 'brin_wi_idx'::regclass)",
+ "select count(*) > 1 from brin_page_items(get_raw_page('brin_wi_idx', 2), 'brin_wi_idx'::regclass)",
't');
$count = $node->safe_psql('postgres',
-"select count(*) > 1 from brin_page_items(get_raw_page('brin_wi_idx', 2), 'brin_wi_idx'::regclass)"
+ "select count(*) > 1 from brin_page_items(get_raw_page('brin_wi_idx', 2), 'brin_wi_idx'::regclass)"
);
is($count, 't', "index got summarized");
$node->stop;
$node->safe_psql('postgres',
'create table t as select now from (select now(), pg_sleep(1)) f');
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');
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
$node->start;
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');
$master->safe_psql('postgres', "create table t$i()");
}
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_wal_lsn()');
or die "standby never caught up";
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");
# This one should raise an error now
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($standby_ts_stdout, '',
my ($psql_ret, $standby_ts_stdout, $standby_ts_stderr) = $standby->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'}
);
is($psql_ret, 3, 'expect error when getting commit timestamp after restart');
is($standby_ts_stdout, '', "standby does not return a value after restart");
$standby->safe_psql('postgres', "create table t11()");
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");
'ALTER EXTENSION test_pg_dump' => {
create_order => 9,
create_sql =>
-'ALTER EXTENSION test_pg_dump ADD TABLE regress_pg_dump_table_added;',
+ 'ALTER EXTENSION test_pg_dump ADD TABLE regress_pg_dump_table_added;',
regexp => qr/^
\QCREATE TABLE public.regress_pg_dump_table_added (\E
\n\s+\Qcol1 integer NOT NULL,\E
'CREATE TABLE regress_pg_dump_table_added' => {
create_order => 7,
create_sql =>
-'CREATE TABLE regress_pg_dump_table_added (col1 int not null, col2 int);',
+ 'CREATE TABLE regress_pg_dump_table_added (col1 int not null, col2 int);',
regexp => qr/^
\QCREATE TABLE public.regress_pg_dump_table_added (\E
\n\s+\Qcol1 integer NOT NULL,\E
'GRANT SELECT regress_pg_dump_table_added pre-ALTER EXTENSION' => {
create_order => 8,
create_sql =>
-'GRANT SELECT ON regress_pg_dump_table_added TO regress_dump_test_role;',
+ 'GRANT SELECT ON regress_pg_dump_table_added TO regress_dump_test_role;',
regexp => qr/^
\QGRANT SELECT ON TABLE public.regress_pg_dump_table_added TO regress_dump_test_role;\E
\n/xm,
'REVOKE SELECT regress_pg_dump_table_added post-ALTER EXTENSION' => {
create_order => 10,
create_sql =>
-'REVOKE SELECT ON regress_pg_dump_table_added FROM regress_dump_test_role;',
+ 'REVOKE SELECT ON regress_pg_dump_table_added FROM regress_dump_test_role;',
regexp => qr/^
\QREVOKE SELECT ON TABLE public.regress_pg_dump_table_added FROM regress_dump_test_role;\E
\n/xm,
if ($TestLib::windows_os)
{
print $hba
-"host replication all $test_localhost/32 sspi include_realm=1 map=regress\n";
+ "host replication all $test_localhost/32 sspi include_realm=1 map=regress\n";
}
close $hba;
}
$params{has_restoring} = 0 unless defined $params{has_restoring};
print
-"# Initializing node \"$node_name\" from backup \"$backup_name\" of node \"$root_name\"\n";
+ "# Initializing node \"$node_name\" from backup \"$backup_name\" of node \"$root_name\"\n";
croak "Backup \"$backup_name\" does not exist at $backup_path"
unless -d $backup_path;
die "connection error: '$$stderr'\nwhile running '@psql_params'"
if $ret == 2;
die
-"error running SQL: '$$stderr'\nwhile running '@psql_params' with sql '$sql'"
+ "error running SQL: '$$stderr'\nwhile running '@psql_params' with sql '$sql'"
if $ret == 3;
die "psql returns $ret: '$$stderr'\nwhile running '@psql_params'";
}
. $lsn_expr . " on "
. $self->name . "\n";
my $query =
-qq[SELECT $lsn_expr <= ${mode}_lsn FROM pg_catalog.pg_stat_replication WHERE application_name = '$standby_name';];
+ qq[SELECT $lsn_expr <= ${mode}_lsn FROM pg_catalog.pg_stat_replication WHERE application_name = '$standby_name';];
$self->poll_query_until('postgres', $query)
or croak "timed out waiting for catchup";
print "done\n";
. $target_lsn . " on "
. $self->name . "\n";
my $query =
-qq[SELECT '$target_lsn' <= ${mode}_lsn FROM pg_catalog.pg_replication_slots WHERE slot_name = '$slot_name';];
+ qq[SELECT '$target_lsn' <= ${mode}_lsn FROM pg_catalog.pg_replication_slots WHERE slot_name = '$slot_name';];
$self->poll_query_until('postgres', $query)
or croak "timed out waiting for catchup";
print "done\n";
'restart_lsn');
return $self->query_hash(
'postgres',
-"SELECT __COLUMNS__ FROM pg_catalog.pg_replication_slots WHERE slot_name = '$slot_name'",
+ "SELECT __COLUMNS__ FROM pg_catalog.pg_replication_slots WHERE slot_name = '$slot_name'",
@columns);
}
unless $timeout->is_expired;
die
-"$exc_save waiting for endpos $endpos with stdout '$stdout', stderr '$stderr'"
+ "$exc_save waiting for endpos $endpos with stdout '$stdout', stderr '$stderr'"
unless wantarray;
}
};
else
{
die
-"pg_recvlogical exited with code '$ret', stdout '$stdout' and stderr '$stderr'"
+ "pg_recvlogical exited with code '$ret', stdout '$stdout' and stderr '$stderr'"
if $ret;
return $stdout;
}
extra_params => [ '-d', $connstr ]);
is( $status == $ret && $stdout eq $target_node->port,
1,
-"connect to node $target_name if mode \"$mode\" and $node1_name,$node2_name listed"
+ "connect to node $target_name if mode \"$mode\" and $node1_name,$node2_name listed"
);
}
sub replay_check
{
my $newval = $node_master->safe_psql('postgres',
-'INSERT INTO replayed(val) SELECT coalesce(max(val),0) + 1 AS newval FROM replayed RETURNING val'
+ 'INSERT INTO replayed(val) SELECT coalesce(max(val),0) + 1 AS newval FROM replayed RETURNING val'
);
$node_master->wait_for_catchup($node_standby_1, 'replay',
$node_master->lsn('insert'));
qq[CREATE TABLE decoding_test(x integer, y text);]);
$node_master->safe_psql('postgres',
-qq[SELECT pg_create_logical_replication_slot('test_slot', 'test_decoding');]);
+ qq[SELECT pg_create_logical_replication_slot('test_slot', 'test_decoding');]
+);
$node_master->safe_psql('postgres',
-qq[INSERT INTO decoding_test(x,y) SELECT s, s::text FROM generate_series(1,10) s;]
+ qq[INSERT INTO decoding_test(x,y) SELECT s, s::text FROM generate_series(1,10) s;]
);
# Basic decoding works
# Insert some rows and verify that we get the same results from pg_recvlogical
# and the SQL interface.
$node_master->safe_psql('postgres',
-qq[INSERT INTO decoding_test(x,y) SELECT s, s::text FROM generate_series(1,4) s;]
+ qq[INSERT INTO decoding_test(x,y) SELECT s, s::text FROM generate_series(1,4) s;]
);
my $expected = q{BEGIN
COMMIT};
my $stdout_sql = $node_master->safe_psql('postgres',
-qq[SELECT data FROM pg_logical_slot_peek_changes('test_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1');]
+ qq[SELECT data FROM pg_logical_slot_peek_changes('test_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1');]
);
is($stdout_sql, $expected, 'got expected output from SQL decoding session');
my $endpos = $node_master->safe_psql('postgres',
-"SELECT lsn FROM pg_logical_slot_peek_changes('test_slot', NULL, NULL) ORDER BY lsn DESC LIMIT 1;"
+ "SELECT lsn FROM pg_logical_slot_peek_changes('test_slot', NULL, NULL) ORDER BY lsn DESC LIMIT 1;"
);
print "waiting to replay $endpos\n";
'got same expected output from pg_recvlogical decoding session');
$node_master->poll_query_until('postgres',
-"SELECT EXISTS (SELECT 1 FROM pg_replication_slots WHERE slot_name = 'test_slot' AND active_pid IS NULL)"
+ "SELECT EXISTS (SELECT 1 FROM pg_replication_slots WHERE slot_name = 'test_slot' AND active_pid IS NULL)"
) or die "slot never became inactive";
$stdout_recv = $node_master->pg_recvlogical_upto(
is( $node_master->psql(
'otherdb',
-"SELECT lsn FROM pg_logical_slot_peek_changes('test_slot', NULL, NULL) ORDER BY lsn DESC LIMIT 1;"
+ "SELECT lsn FROM pg_logical_slot_peek_changes('test_slot', NULL, NULL) ORDER BY lsn DESC LIMIT 1;"
),
3,
'replaying logical slot from another database fails');
$node_master->safe_psql('otherdb',
-qq[SELECT pg_create_logical_replication_slot('otherdb_slot', 'test_decoding');]
+ qq[SELECT pg_create_logical_replication_slot('otherdb_slot', 'test_decoding');]
);
# make sure you can't drop a slot while active
[ 'pg_recvlogical', '-d', $node_master->connstr('otherdb'),
'-S', 'otherdb_slot', '-f', '-', '--start' ]);
$node_master->poll_query_until('otherdb',
-"SELECT EXISTS (SELECT 1 FROM pg_replication_slots WHERE slot_name = 'otherdb_slot' AND active_pid IS NOT NULL)"
+ "SELECT EXISTS (SELECT 1 FROM pg_replication_slots WHERE slot_name = 'otherdb_slot' AND active_pid IS NOT NULL)"
) or die "slot never became active";
is($node_master->psql('postgres', 'DROP DATABASE otherdb'),
3, 'dropping a DB with active logical slots fails');
}
$node_master->poll_query_until('otherdb',
-"SELECT EXISTS (SELECT 1 FROM pg_replication_slots WHERE slot_name = 'otherdb_slot' AND active_pid IS NULL)"
+ "SELECT EXISTS (SELECT 1 FROM pg_replication_slots WHERE slot_name = 'otherdb_slot' AND active_pid IS NULL)"
) or die "slot never became inactive";
is($node_master->psql('postgres', 'DROP DATABASE otherdb'),
# 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;";
+ "SELECT application_name, sync_priority, sync_state FROM pg_stat_replication ORDER BY application_name;";
# Check that sync_state of each standby is expected (waiting till it is).
# If $setting is given, synchronous_standby_names is set to it and
note "testing logical timeline following with a filesystem-level copy";
$node_master->safe_psql('postgres',
-"SELECT pg_create_logical_replication_slot('before_basebackup', 'test_decoding');"
+ "SELECT pg_create_logical_replication_slot('before_basebackup', 'test_decoding');"
);
$node_master->safe_psql('postgres', "CREATE TABLE decoding(blah text);");
$node_master->safe_psql('postgres',
# the same physical copy trick, so:
$node_master->safe_psql('postgres', 'CREATE DATABASE dropme;');
$node_master->safe_psql('dropme',
-"SELECT pg_create_logical_replication_slot('dropme_slot', 'test_decoding');");
+ "SELECT pg_create_logical_replication_slot('dropme_slot', 'test_decoding');"
+);
$node_master->safe_psql('postgres', 'CHECKPOINT;');
# Back to testing failover...
$node_master->safe_psql('postgres',
-"SELECT pg_create_logical_replication_slot('after_basebackup', 'test_decoding');"
+ "SELECT pg_create_logical_replication_slot('after_basebackup', 'test_decoding');"
);
$node_master->safe_psql('postgres',
"INSERT INTO decoding(blah) VALUES ('afterbb');");
# Shouldn't be able to read from slot created after base backup
($ret, $stdout, $stderr) = $node_replica->psql('postgres',
-"SELECT data FROM pg_logical_slot_peek_changes('after_basebackup', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1');"
+ "SELECT data FROM pg_logical_slot_peek_changes('after_basebackup', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1');"
);
is($ret, 3, 'replaying from after_basebackup slot fails');
like(
# Should be able to read from slot created before base backup
($ret, $stdout, $stderr) = $node_replica->psql(
'postgres',
-"SELECT data FROM pg_logical_slot_peek_changes('before_basebackup', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1');",
+ "SELECT data FROM pg_logical_slot_peek_changes('before_basebackup', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1');",
timeout => 30);
is($ret, 0, 'replay from slot before_basebackup succeeds');
# of the last transaction. There's no max(pg_lsn), so:
my $endpos = $node_replica->safe_psql('postgres',
-"SELECT lsn FROM pg_logical_slot_peek_changes('before_basebackup', NULL, NULL) ORDER BY lsn DESC LIMIT 1;"
+ "SELECT lsn FROM pg_logical_slot_peek_changes('before_basebackup', NULL, NULL) ORDER BY lsn DESC LIMIT 1;"
);
# now use the walsender protocol to peek the slot changes and make sure we see
$node_standby->start;
$psql_rc = $node_master->psql('postgres', "COMMIT PREPARED 'xact_012_1'");
is($psql_rc, '0',
-"Restore of PGPROC_MAX_CACHED_SUBXIDS+ prepared transaction on promoted standby"
+ "Restore of PGPROC_MAX_CACHED_SUBXIDS+ prepared transaction on promoted standby"
);
$node_master->psql(
$node_standby->start;
$psql_rc = $node_master->psql('postgres', "ROLLBACK PREPARED 'xact_012_1'");
is($psql_rc, '0',
-"Rollback of PGPROC_MAX_CACHED_SUBXIDS+ prepared transaction on promoted standby"
+ "Rollback of PGPROC_MAX_CACHED_SUBXIDS+ prepared transaction on promoted standby"
);
$node_master->psql(
ok( pump_until(
$killme,
\$killme_stderr,
-qr/WARNING: terminating connection because of crash of another server process|server closed the connection unexpectedly/m
+ qr/WARNING: terminating connection because of crash of another server process|server closed the connection unexpectedly/m
),
"psql query died successfully after SIGQUIT");
$killme_stderr = '';
ok( pump_until(
$monitor,
\$monitor_stderr,
-qr/WARNING: terminating connection because of crash of another server process|server closed the connection unexpectedly/m
+ qr/WARNING: terminating connection because of crash of another server process|server closed the connection unexpectedly/m
),
"psql monitor died successfully after SIGQUIT");
$monitor->finish;
ok( pump_until(
$monitor,
\$monitor_stderr,
-qr/WARNING: terminating connection because of crash of another server process|server closed the connection unexpectedly/m
+ qr/WARNING: terminating connection because of crash of another server process|server closed the connection unexpectedly/m
),
"psql monitor died successfully after SIGKILL");
$monitor->finish;
is( $node->safe_psql(
'postgres',
-'INSERT INTO alive VALUES($$before-orderly-restart$$) RETURNING status'),
+ 'INSERT INTO alive VALUES($$before-orderly-restart$$) RETURNING status'
+ ),
'before-orderly-restart',
'can still write after crash restart');
$node->restart();
is( $node->safe_psql('postgres', 'SELECT * FROM alive'),
-"committed-before-sigquit\ncommitted-before-sigkill\nbefore-orderly-restart",
+ "committed-before-sigquit\ncommitted-before-sigkill\nbefore-orderly-restart",
'data survived');
is( $node->safe_psql(
if (defined($password))
{
$node->psql('postgres',
-"SET password_encryption='$password_enc'; ALTER USER ssltestuser PASSWORD '$password';"
+ "SET password_encryption='$password_enc'; ALTER USER ssltestuser PASSWORD '$password';"
);
$node->psql('postgres',
-"SET password_encryption='$password_enc'; ALTER USER anotheruser PASSWORD '$password';"
+ "SET password_encryption='$password_enc'; ALTER USER anotheruser PASSWORD '$password';"
);
}
# When connecting to certdb, also check the client certificate.
open my $hba, '>', "$pgdata/pg_hba.conf";
print $hba
-"# TYPE DATABASE USER ADDRESS METHOD\n";
+ "# TYPE DATABASE USER ADDRESS METHOD\n";
print $hba
-"hostssl trustdb all $serverhost/32 $authmethod\n";
+ "hostssl trustdb all $serverhost/32 $authmethod\n";
print $hba
-"hostssl trustdb all ::1/128 $authmethod\n";
+ "hostssl trustdb all ::1/128 $authmethod\n";
print $hba
-"hostssl certdb all $serverhost/32 cert\n";
+ "hostssl certdb all $serverhost/32 cert\n";
print $hba
-"hostssl certdb all ::1/128 cert\n";
+ "hostssl certdb all ::1/128 cert\n";
close $hba;
}
switch_server_cert($node, 'server-cn-only');
$common_connstr =
-"user=ssltestuser dbname=trustdb sslcert=invalid hostaddr=$SERVERHOSTADDR host=common-name.pg-ssltest.test";
+ "user=ssltestuser dbname=trustdb sslcert=invalid hostaddr=$SERVERHOSTADDR host=common-name.pg-ssltest.test";
# The server should not accept non-SSL connections.
test_connect_fails(
# A CRL belonging to a different CA is not accepted, fails
test_connect_fails(
$common_connstr,
-"sslrootcert=ssl/root+server_ca.crt sslmode=verify-ca sslcrl=ssl/client.crl",
+ "sslrootcert=ssl/root+server_ca.crt sslmode=verify-ca sslcrl=ssl/client.crl",
qr/SSL error/,
"CRL belonging to a different CA");
# With the correct CRL, succeeds (this cert is not revoked)
test_connect_ok(
$common_connstr,
-"sslrootcert=ssl/root+server_ca.crt sslmode=verify-ca sslcrl=ssl/root+server.crl",
+ "sslrootcert=ssl/root+server_ca.crt sslmode=verify-ca sslcrl=ssl/root+server.crl",
"CRL with a non-revoked cert");
# Check that connecting with verify-full fails, when the hostname doesn't
# match the hostname in the server's certificate.
$common_connstr =
-"user=ssltestuser dbname=trustdb sslcert=invalid sslrootcert=ssl/root+server_ca.crt hostaddr=$SERVERHOSTADDR";
+ "user=ssltestuser dbname=trustdb sslcert=invalid sslrootcert=ssl/root+server_ca.crt hostaddr=$SERVERHOSTADDR";
test_connect_ok(
$common_connstr,
test_connect_fails(
$common_connstr,
"sslmode=verify-full host=wronghost.test",
-qr/\Qserver certificate for "common-name.pg-ssltest.test" does not match host name "wronghost.test"\E/,
+ qr/\Qserver certificate for "common-name.pg-ssltest.test" does not match host name "wronghost.test"\E/,
"mismatch between host name and server certificate sslmode=verify-full");
# Test Subject Alternative Names.
switch_server_cert($node, 'server-multiple-alt-names');
$common_connstr =
-"user=ssltestuser dbname=trustdb sslcert=invalid sslrootcert=ssl/root+server_ca.crt hostaddr=$SERVERHOSTADDR sslmode=verify-full";
+ "user=ssltestuser dbname=trustdb sslcert=invalid sslrootcert=ssl/root+server_ca.crt hostaddr=$SERVERHOSTADDR sslmode=verify-full";
test_connect_ok(
$common_connstr,
test_connect_fails(
$common_connstr,
"host=wronghost.alt-name.pg-ssltest.test",
-qr/\Qserver certificate for "dns1.alt-name.pg-ssltest.test" (and 2 other names) does not match host name "wronghost.alt-name.pg-ssltest.test"\E/,
+ qr/\Qserver certificate for "dns1.alt-name.pg-ssltest.test" (and 2 other names) does not match host name "wronghost.alt-name.pg-ssltest.test"\E/,
"host name not matching with X.509 Subject Alternative Names");
test_connect_fails(
$common_connstr,
"host=deep.subdomain.wildcard.pg-ssltest.test",
-qr/\Qserver certificate for "dns1.alt-name.pg-ssltest.test" (and 2 other names) does not match host name "deep.subdomain.wildcard.pg-ssltest.test"\E/,
+ qr/\Qserver certificate for "dns1.alt-name.pg-ssltest.test" (and 2 other names) does not match host name "deep.subdomain.wildcard.pg-ssltest.test"\E/,
"host name not matching with X.509 Subject Alternative Names wildcard");
# Test certificate with a single Subject Alternative Name. (this gives a
switch_server_cert($node, 'server-single-alt-name');
$common_connstr =
-"user=ssltestuser dbname=trustdb sslcert=invalid sslrootcert=ssl/root+server_ca.crt hostaddr=$SERVERHOSTADDR sslmode=verify-full";
+ "user=ssltestuser dbname=trustdb sslcert=invalid sslrootcert=ssl/root+server_ca.crt hostaddr=$SERVERHOSTADDR sslmode=verify-full";
test_connect_ok(
$common_connstr,
test_connect_fails(
$common_connstr,
"host=wronghost.alt-name.pg-ssltest.test",
-qr/\Qserver certificate for "single.alt-name.pg-ssltest.test" does not match host name "wronghost.alt-name.pg-ssltest.test"\E/,
+ qr/\Qserver certificate for "single.alt-name.pg-ssltest.test" does not match host name "wronghost.alt-name.pg-ssltest.test"\E/,
"host name not matching with a single X.509 Subject Alternative Name");
test_connect_fails(
$common_connstr,
"host=deep.subdomain.wildcard.pg-ssltest.test",
-qr/\Qserver certificate for "single.alt-name.pg-ssltest.test" does not match host name "deep.subdomain.wildcard.pg-ssltest.test"\E/,
-"host name not matching with a single X.509 Subject Alternative Name wildcard"
+ qr/\Qserver certificate for "single.alt-name.pg-ssltest.test" does not match host name "deep.subdomain.wildcard.pg-ssltest.test"\E/,
+ "host name not matching with a single X.509 Subject Alternative Name wildcard"
);
# Test server certificate with a CN and SANs. Per RFCs 2818 and 6125, the CN
switch_server_cert($node, 'server-cn-and-alt-names');
$common_connstr =
-"user=ssltestuser dbname=trustdb sslcert=invalid sslrootcert=ssl/root+server_ca.crt hostaddr=$SERVERHOSTADDR sslmode=verify-full";
+ "user=ssltestuser dbname=trustdb sslcert=invalid sslrootcert=ssl/root+server_ca.crt hostaddr=$SERVERHOSTADDR sslmode=verify-full";
test_connect_ok(
$common_connstr,
test_connect_fails(
$common_connstr,
"host=common-name.pg-ssltest.test",
-qr/\Qserver certificate for "dns1.alt-name.pg-ssltest.test" (and 1 other name) does not match host name "common-name.pg-ssltest.test"\E/,
+ qr/\Qserver certificate for "dns1.alt-name.pg-ssltest.test" (and 1 other name) does not match host name "common-name.pg-ssltest.test"\E/,
"certificate with both a CN and SANs ignores CN");
# Finally, test a server certificate that has no CN or SANs. Of course, that's
# not a very sensible certificate, but libpq should handle it gracefully.
switch_server_cert($node, 'server-no-names');
$common_connstr =
-"user=ssltestuser dbname=trustdb sslcert=invalid sslrootcert=ssl/root+server_ca.crt hostaddr=$SERVERHOSTADDR";
+ "user=ssltestuser dbname=trustdb sslcert=invalid sslrootcert=ssl/root+server_ca.crt hostaddr=$SERVERHOSTADDR";
test_connect_ok(
$common_connstr,
switch_server_cert($node, 'server-revoked');
$common_connstr =
-"user=ssltestuser dbname=trustdb sslcert=invalid hostaddr=$SERVERHOSTADDR host=common-name.pg-ssltest.test";
+ "user=ssltestuser dbname=trustdb sslcert=invalid hostaddr=$SERVERHOSTADDR host=common-name.pg-ssltest.test";
# Without the CRL, succeeds. With it, fails.
test_connect_ok(
"connects without client-side CRL");
test_connect_fails(
$common_connstr,
-"sslrootcert=ssl/root+server_ca.crt sslmode=verify-ca sslcrl=ssl/root+server.crl",
+ "sslrootcert=ssl/root+server_ca.crt sslmode=verify-ca sslcrl=ssl/root+server.crl",
qr/SSL error/,
"does not connect with client-side CRL");
note "running server tests";
$common_connstr =
-"sslrootcert=ssl/root+server_ca.crt sslmode=require dbname=certdb hostaddr=$SERVERHOSTADDR";
+ "sslrootcert=ssl/root+server_ca.crt sslmode=require dbname=certdb hostaddr=$SERVERHOSTADDR";
# no client cert
test_connect_fails(
# client key with wrong permissions
test_connect_fails(
$common_connstr,
-"user=ssltestuser sslcert=ssl/client.crt sslkey=ssl/client_wrongperms_tmp.key",
-qr!\Qprivate key file "ssl/client_wrongperms_tmp.key" has group or world access\E!,
+ "user=ssltestuser sslcert=ssl/client.crt sslkey=ssl/client_wrongperms_tmp.key",
+ qr!\Qprivate key file "ssl/client_wrongperms_tmp.key" has group or world access\E!,
"certificate authorization fails because of file permissions");
# client cert belonging to another user
$common_connstr,
"user=anotheruser sslcert=ssl/client.crt sslkey=ssl/client_tmp.key",
qr/certificate authentication failed for user "anotheruser"/,
-"certificate authorization fails with client cert belonging to another user");
+ "certificate authorization fails with client cert belonging to another user"
+);
# revoked client cert
test_connect_fails(
$common_connstr,
-"user=ssltestuser sslcert=ssl/client-revoked.crt sslkey=ssl/client-revoked_tmp.key",
+ "user=ssltestuser sslcert=ssl/client-revoked.crt sslkey=ssl/client-revoked_tmp.key",
qr/SSL error/,
"certificate authorization fails with revoked client cert");
# intermediate client_ca.crt is provided by client, and isn't in server's ssl_ca_file
switch_server_cert($node, 'server-cn-only', 'root_ca');
$common_connstr =
-"user=ssltestuser dbname=certdb sslkey=ssl/client_tmp.key sslrootcert=ssl/root+server_ca.crt hostaddr=$SERVERHOSTADDR";
+ "user=ssltestuser dbname=certdb sslkey=ssl/client_tmp.key sslrootcert=ssl/root+server_ca.crt hostaddr=$SERVERHOSTADDR";
test_connect_ok(
$common_connstr,
test_connect_fails(
$common_connstr,
"scram_channel_binding=tls-server-end-point",
-qr/channel binding type "tls-server-end-point" is not supported by this build/,
+ qr/channel binding type "tls-server-end-point" is not supported by this build/,
"SCRAM authentication with tls-server-end-point as channel binding");
$number_of_tests++;
}
$node_publisher->safe_psql('postgres',
"INSERT INTO tab_mixed (a, b) VALUES (1, 'foo')");
$node_publisher->safe_psql('postgres',
-"CREATE TABLE tab_include (a int, b text, CONSTRAINT covering PRIMARY KEY(a) INCLUDE(b))"
+ "CREATE TABLE tab_include (a int, b text, CONSTRAINT covering PRIMARY KEY(a) INCLUDE(b))"
);
# Setup structure on subscriber
# replication of the table with included index
$node_subscriber->safe_psql('postgres',
-"CREATE TABLE tab_include (a int, b text, CONSTRAINT covering PRIMARY KEY(a) INCLUDE(b))"
+ "CREATE TABLE tab_include (a int, b text, CONSTRAINT covering PRIMARY KEY(a) INCLUDE(b))"
);
# Setup logical replication
$node_publisher->safe_psql('postgres',
"CREATE PUBLICATION tap_pub_ins_only WITH (publish = insert)");
$node_publisher->safe_psql('postgres',
-"ALTER PUBLICATION tap_pub ADD TABLE tab_rep, tab_full, tab_full2, tab_mixed, tab_include"
+ "ALTER PUBLICATION tap_pub ADD TABLE tab_rep, tab_full, tab_full2, tab_mixed, tab_include"
);
$node_publisher->safe_psql('postgres',
"ALTER PUBLICATION tap_pub_ins_only ADD TABLE tab_ins");
my $appname = 'tap_sub';
$node_subscriber->safe_psql('postgres',
-"CREATE SUBSCRIPTION tap_sub CONNECTION '$publisher_connstr application_name=$appname' PUBLICATION tap_pub, tap_pub_ins_only"
+ "CREATE SUBSCRIPTION tap_sub CONNECTION '$publisher_connstr application_name=$appname' PUBLICATION tap_pub, tap_pub_ins_only"
);
$node_publisher->wait_for_catchup($appname);
# Also wait for initial table sync to finish
my $synced_query =
-"SELECT count(1) = 0 FROM pg_subscription_rel WHERE srsubstate NOT IN ('r', 's');";
+ "SELECT count(1) = 0 FROM pg_subscription_rel WHERE srsubstate NOT IN ('r', 's');";
$node_subscriber->poll_query_until('postgres', $synced_query)
or die "Timed out while waiting for subscriber to synchronize data";
"SELECT pid FROM pg_stat_replication WHERE application_name = '$appname';"
);
$node_subscriber->safe_psql('postgres',
-"ALTER SUBSCRIPTION tap_sub CONNECTION 'application_name=$appname $publisher_connstr'"
+ "ALTER SUBSCRIPTION tap_sub CONNECTION 'application_name=$appname $publisher_connstr'"
);
$node_publisher->poll_query_until('postgres',
-"SELECT pid != $oldpid FROM pg_stat_replication WHERE application_name = '$appname';"
+ "SELECT pid != $oldpid FROM pg_stat_replication WHERE application_name = '$appname';"
) or die "Timed out while waiting for apply to restart";
$oldpid = $node_publisher->safe_psql('postgres',
"SELECT pid FROM pg_stat_replication WHERE application_name = '$appname';"
);
$node_subscriber->safe_psql('postgres',
-"ALTER SUBSCRIPTION tap_sub SET PUBLICATION tap_pub_ins_only WITH (copy_data = false)"
+ "ALTER SUBSCRIPTION tap_sub SET PUBLICATION tap_pub_ins_only WITH (copy_data = false)"
);
$node_publisher->poll_query_until('postgres',
-"SELECT pid != $oldpid FROM pg_stat_replication WHERE application_name = '$appname';"
+ "SELECT pid != $oldpid FROM pg_stat_replication WHERE application_name = '$appname';"
) or die "Timed out while waiting for apply to restart";
$node_publisher->safe_psql('postgres',
$node_subscriber->safe_psql('postgres',
"ALTER SUBSCRIPTION tap_sub RENAME TO tap_sub_renamed");
$node_publisher->poll_query_until('postgres',
-"SELECT pid != $oldpid FROM pg_stat_replication WHERE application_name = '$appname';"
+ "SELECT pid != $oldpid FROM pg_stat_replication WHERE application_name = '$appname';"
) or die "Timed out while waiting for apply to restart";
# check all the cleanup
my $appname = 'tap_sub';
$node_subscriber->safe_psql('postgres',
-"CREATE SUBSCRIPTION tap_sub CONNECTION '$publisher_connstr application_name=$appname' PUBLICATION tap_pub WITH (slot_name = tap_sub_slot)"
+ "CREATE SUBSCRIPTION tap_sub CONNECTION '$publisher_connstr application_name=$appname' PUBLICATION tap_pub WITH (slot_name = tap_sub_slot)"
);
$node_publisher->wait_for_catchup($appname);
# Wait for initial sync to finish as well
my $synced_query =
-"SELECT count(1) = 0 FROM pg_subscription_rel WHERE srsubstate NOT IN ('s', 'r');";
+ "SELECT count(1) = 0 FROM pg_subscription_rel WHERE srsubstate NOT IN ('s', 'r');";
$node_subscriber->poll_query_until('postgres', $synced_query)
or die "Timed out while waiting for subscriber to synchronize data";
$node_publisher->safe_psql('postgres',
"CREATE TABLE tab_fk (bid int PRIMARY KEY);");
$node_publisher->safe_psql('postgres',
-"CREATE TABLE tab_fk_ref (id int PRIMARY KEY, bid int REFERENCES tab_fk (bid));"
+ "CREATE TABLE tab_fk_ref (id int PRIMARY KEY, bid int REFERENCES tab_fk (bid));"
);
# Setup structure on subscriber
$node_subscriber->safe_psql('postgres',
"CREATE TABLE tab_fk (bid int PRIMARY KEY);");
$node_subscriber->safe_psql('postgres',
-"CREATE TABLE tab_fk_ref (id int PRIMARY KEY, bid int REFERENCES tab_fk (bid));"
+ "CREATE TABLE tab_fk_ref (id int PRIMARY KEY, bid int REFERENCES tab_fk (bid));"
);
# Setup logical replication
my $appname = 'tap_sub';
$node_subscriber->safe_psql('postgres',
-"CREATE SUBSCRIPTION tap_sub CONNECTION '$publisher_connstr application_name=$appname' PUBLICATION tap_pub WITH (copy_data = false)"
+ "CREATE SUBSCRIPTION tap_sub CONNECTION '$publisher_connstr application_name=$appname' PUBLICATION tap_pub WITH (copy_data = false)"
);
$node_publisher->wait_for_catchup($appname);
my $appname = 'tap_sub';
$node_subscriber->safe_psql('postgres',
-"CREATE SUBSCRIPTION tap_sub CONNECTION '$publisher_connstr application_name=$appname' PUBLICATION tap_pub"
+ "CREATE SUBSCRIPTION tap_sub CONNECTION '$publisher_connstr application_name=$appname' PUBLICATION tap_pub"
);
$node_publisher->wait_for_catchup($appname);
# Also wait for initial table sync to finish
my $synced_query =
-"SELECT count(1) = 0 FROM pg_subscription_rel WHERE srsubstate NOT IN ('r', 's');";
+ "SELECT count(1) = 0 FROM pg_subscription_rel WHERE srsubstate NOT IN ('r', 's');";
$node_subscriber->poll_query_until('postgres', $synced_query)
or die "Timed out while waiting for subscriber to synchronize data";
# recreate the subscription, it will try to do initial copy
$node_subscriber->safe_psql('postgres',
-"CREATE SUBSCRIPTION tap_sub CONNECTION '$publisher_connstr application_name=$appname' PUBLICATION tap_pub"
+ "CREATE SUBSCRIPTION tap_sub CONNECTION '$publisher_connstr application_name=$appname' PUBLICATION tap_pub"
);
# but it will be stuck on data copy as it will fail on constraint
# now check another subscription for the same node pair
$node_subscriber->safe_psql('postgres',
-"CREATE SUBSCRIPTION tap_sub2 CONNECTION '$publisher_connstr application_name=$appname' PUBLICATION tap_pub WITH (copy_data = false)"
+ "CREATE SUBSCRIPTION tap_sub2 CONNECTION '$publisher_connstr application_name=$appname' PUBLICATION tap_pub WITH (copy_data = false)"
);
# wait for it to start
$node_subscriber->poll_query_until('postgres',
-"SELECT pid IS NOT NULL FROM pg_stat_subscription WHERE subname = 'tap_sub2' AND relid IS NULL"
+ "SELECT pid IS NOT NULL FROM pg_stat_subscription WHERE subname = 'tap_sub2' AND relid IS NULL"
) or die "Timed out while waiting for subscriber to start";
# and drop both subscriptions
# recreate the subscription again
$node_subscriber->safe_psql('postgres',
-"CREATE SUBSCRIPTION tap_sub CONNECTION '$publisher_connstr application_name=$appname' PUBLICATION tap_pub"
+ "CREATE SUBSCRIPTION tap_sub CONNECTION '$publisher_connstr application_name=$appname' PUBLICATION tap_pub"
);
# and wait for data sync to finish again
$node_publisher->safe_psql('postgres',
"CREATE PUBLICATION mypub FOR ALL TABLES;");
$node_subscriber->safe_psql('postgres',
-"CREATE SUBSCRIPTION mysub CONNECTION '$publisher_connstr application_name=$appname' PUBLICATION mypub;"
+ "CREATE SUBSCRIPTION mysub CONNECTION '$publisher_connstr application_name=$appname' PUBLICATION mypub;"
);
$node_publisher->wait_for_catchup($appname);
# Wait for initial sync to finish as well
my $synced_query =
-"SELECT count(1) = 0 FROM pg_subscription_rel WHERE srsubstate NOT IN ('s', 'r');";
+ "SELECT count(1) = 0 FROM pg_subscription_rel WHERE srsubstate NOT IN ('s', 'r');";
$node_subscriber->poll_query_until('postgres', $synced_query)
or die "Timed out while waiting for subscriber to synchronize data";
$node_publisher->safe_psql('postgres',
"CREATE PUBLICATION mypub FOR ALL TABLES;");
$node_subscriber->safe_psql('postgres',
-"CREATE SUBSCRIPTION mysub CONNECTION '$publisher_connstr application_name=$appname' PUBLICATION mypub;"
+ "CREATE SUBSCRIPTION mysub CONNECTION '$publisher_connstr application_name=$appname' PUBLICATION mypub;"
);
$node_publisher->wait_for_catchup($appname);
# Wait for initial sync to finish as well
my $synced_query =
-"SELECT count(1) = 0 FROM pg_subscription_rel WHERE srsubstate NOT IN ('s', 'r');";
+ "SELECT count(1) = 0 FROM pg_subscription_rel WHERE srsubstate NOT IN ('s', 'r');";
$node_subscriber->poll_query_until('postgres', $synced_query)
or die "Timed out while waiting for subscriber to synchronize data";
$node_publisher->safe_psql('postgres',
"CREATE PUBLICATION mypub FOR ALL TABLES;");
$node_subscriber->safe_psql('postgres',
-"CREATE SUBSCRIPTION mysub CONNECTION '$publisher_connstr application_name=$appname' PUBLICATION mypub;"
+ "CREATE SUBSCRIPTION mysub CONNECTION '$publisher_connstr application_name=$appname' PUBLICATION mypub;"
);
$node_publisher->wait_for_catchup($appname);
# Setup structure on subscriber
$node_subscriber->safe_psql('postgres',
-"CREATE TABLE test_tab (a int primary key, b text, c timestamptz DEFAULT now(), d bigint DEFAULT 999, e int GENERATED BY DEFAULT AS IDENTITY)"
+ "CREATE TABLE test_tab (a int primary key, b text, c timestamptz DEFAULT now(), d bigint DEFAULT 999, e int GENERATED BY DEFAULT AS IDENTITY)"
);
# Setup logical replication
my $appname = 'tap_sub';
$node_subscriber->safe_psql('postgres',
-"CREATE SUBSCRIPTION tap_sub CONNECTION '$publisher_connstr application_name=$appname' PUBLICATION tap_pub"
+ "CREATE SUBSCRIPTION tap_sub CONNECTION '$publisher_connstr application_name=$appname' PUBLICATION tap_pub"
);
$node_publisher->wait_for_catchup($appname);
# Also wait for initial table sync to finish
my $synced_query =
-"SELECT count(1) = 0 FROM pg_subscription_rel WHERE srsubstate NOT IN ('r', 's');";
+ "SELECT count(1) = 0 FROM pg_subscription_rel WHERE srsubstate NOT IN ('r', 's');";
$node_subscriber->poll_query_until('postgres', $synced_query)
or die "Timed out while waiting for subscriber to synchronize data";
$node_publisher->wait_for_catchup($appname);
$result = $node_subscriber->safe_psql('postgres',
-"SELECT count(*), count(extract(epoch from c) = 987654321), count(d = 999) FROM test_tab"
+ "SELECT count(*), count(extract(epoch from c) = 987654321), count(d = 999) FROM test_tab"
);
is($result, qq(2|2|2), 'check extra columns contain locally changed data');
$node_publisher->safe_psql('postgres',
"CREATE PUBLICATION mypub FOR ALL TABLES;");
$node_subscriber->safe_psql('postgres',
-"CREATE SUBSCRIPTION mysub CONNECTION '$publisher_connstr application_name=$appname' PUBLICATION mypub;"
+ "CREATE SUBSCRIPTION mysub CONNECTION '$publisher_connstr application_name=$appname' PUBLICATION mypub;"
);
$node_publisher->safe_psql('postgres',
$node_publisher->safe_psql('postgres',
"CREATE PUBLICATION pub3 FOR TABLE tab3, tab4");
$node_subscriber->safe_psql('postgres',
-"CREATE SUBSCRIPTION sub1 CONNECTION '$publisher_connstr application_name=sub1' PUBLICATION pub1"
+ "CREATE SUBSCRIPTION sub1 CONNECTION '$publisher_connstr application_name=sub1' PUBLICATION pub1"
);
$node_subscriber->safe_psql('postgres',
-"CREATE SUBSCRIPTION sub2 CONNECTION '$publisher_connstr application_name=sub2' PUBLICATION pub2"
+ "CREATE SUBSCRIPTION sub2 CONNECTION '$publisher_connstr application_name=sub2' PUBLICATION pub2"
);
$node_subscriber->safe_psql('postgres',
-"CREATE SUBSCRIPTION sub3 CONNECTION '$publisher_connstr application_name=sub3' PUBLICATION pub3"
+ "CREATE SUBSCRIPTION sub3 CONNECTION '$publisher_connstr application_name=sub3' PUBLICATION pub3"
);
# Wait for initial sync of all subscriptions
my $synced_query =
-"SELECT count(1) = 0 FROM pg_subscription_rel WHERE srsubstate NOT IN ('r', 's');";
+ "SELECT count(1) = 0 FROM pg_subscription_rel WHERE srsubstate NOT IN ('r', 's');";
$node_subscriber->poll_query_until('postgres', $synced_query)
or die "Timed out while waiting for subscriber to synchronize data";
&& !grep { $cur_nonterminal eq $_ } @rhs)
{
print
-"Right recursion in rule $rule_number: $cur_nonterminal := $rhs\n";
+ "Right recursion in rule $rule_number: $cur_nonterminal := $rhs\n";
}
}
}
# Apply the desired patch.
$ccode =~
-s|(struct yyguts_t \* yyg = \(struct yyguts_t\*\)yyscanner; /\* This var may be unused depending upon options. \*/
+ s|(struct yyguts_t \* yyg = \(struct yyguts_t\*\)yyscanner; /\* This var may be unused depending upon options. \*/
.*?)
return yy_is_jam \? 0 : yy_current_state;
|$1
{
my ($dt) = @_;
$dt =~
-/^(\d\d\d\d)-(\d\d)-(\d\d)\s+(\d\d):(\d\d):(\d\d)\s+([-+])(\d\d)(\d\d)$/;
+ /^(\d\d\d\d)-(\d\d)-(\d\d)\s+(\d\d):(\d\d):(\d\d)\s+([-+])(\d\d)(\d\d)$/;
my $gm = Time::Local::timegm($6, $5, $4, $3, $2 - 1, $1);
my $tzoffset = ($8 * 60 + $9) * 60;
$tzoffset = -$tzoffset if $7 eq '-';
my $obj = shift @pieces;
$sql .= "-- $se --> $de\n";
$sql .=
-"CREATE OR REPLACE FUNCTION $func (INTEGER, INTEGER, CSTRING, INTERNAL, INTEGER) RETURNS VOID AS '\$libdir/$obj', '$func' LANGUAGE C STRICT;\n";
+ "CREATE OR REPLACE FUNCTION $func (INTEGER, INTEGER, CSTRING, INTERNAL, INTEGER) RETURNS VOID AS '\$libdir/$obj', '$func' LANGUAGE C STRICT;\n";
$sql .=
-"COMMENT ON FUNCTION $func(INTEGER, INTEGER, CSTRING, INTERNAL, INTEGER) IS 'internal conversion function for $se to $de';\n";
+ "COMMENT ON FUNCTION $func(INTEGER, INTEGER, CSTRING, INTERNAL, INTEGER) IS 'internal conversion function for $se to $de';\n";
$sql .= "DROP CONVERSION pg_catalog.$name;\n";
$sql .=
-"CREATE DEFAULT CONVERSION pg_catalog.$name FOR '$se' TO '$de' FROM $func;\n";
+ "CREATE DEFAULT CONVERSION pg_catalog.$name FOR '$se' TO '$de' FROM $func;\n";
$sql .=
-"COMMENT ON CONVERSION pg_catalog.$name IS 'conversion for $se to $de';\n\n";
+ "COMMENT ON CONVERSION pg_catalog.$name IS 'conversion for $se to $de';\n\n";
}
open($F, '>', "$target/share/conversion_create.sql")
|| die "Could not write to conversion_create.sql\n";
# Special case for contrib/spi
$flist =
-"autoinc.example insert_username.example moddatetime.example refint.example timetravel.example"
+ "autoinc.example insert_username.example moddatetime.example refint.example timetravel.example"
if ($module eq 'spi');
foreach my $f (split /\s+/, $flist)
{
my @args = (
"$nlspath\\bin\\msgfmt",
'-o',
-"$target\\share\\locale\\$lang\\LC_MESSAGES\\$prgm-$majorver.mo",
+ "$target\\share\\locale\\$lang\\LC_MESSAGES\\$prgm-$majorver.mo",
$_);
system(@args) && croak("Could not run msgfmt on $dir\\$_");
print ".";
if ($grammarFile =~ /\.y$/)
{
$outputFile =~
-s{^src\\pl\\plpgsql\\src\\gram.c$}{src\\pl\\plpgsql\\src\\pl_gram.c};
+ s{^src\\pl\\plpgsql\\src\\gram.c$}{src\\pl\\plpgsql\\src\\pl_gram.c};
print $f <<EOF;
<CustomBuild Include="$grammarFile">
<Message Condition="'\$(Configuration)|\$(Platform)'=='Debug|$self->{platform}'">Running bison on $grammarFile</Message>
if ($self->{disablelinkerwarnings})
{
print $f
-" <AdditionalOptions>/ignore:$self->{disablelinkerwarnings} \%(AdditionalOptions)</AdditionalOptions>\n";
+ " <AdditionalOptions>/ignore:$self->{disablelinkerwarnings} \%(AdditionalOptions)</AdditionalOptions>\n";
}
if ($self->{implib})
{
else
{
die
-"could not identify perl library version matching pattern $perl_path\n";
+ "could not identify perl library version matching pattern $perl_path\n";
}
# Add defines from Perl's ccflags; see PGAC_CHECK_PERL_EMBED_CCFLAGS
{
s{PG_VERSION "[^"]+"}{PG_VERSION "$self->{strver}$extraver"};
s{PG_VERSION_NUM \d+}{PG_VERSION_NUM $self->{numver}};
-s{PG_VERSION_STR "[^"]+"}{PG_VERSION_STR "PostgreSQL $self->{strver}$extraver, compiled by Visual C++ build " CppAsString2(_MSC_VER) ", $bits-bit"};
+ s{PG_VERSION_STR "[^"]+"}{PG_VERSION_STR "PostgreSQL $self->{strver}$extraver, compiled by Visual C++ build " CppAsString2(_MSC_VER) ", $bits-bit"};
print $o $_;
}
print $o "#define PG_MAJORVERSION \"$self->{majorver}\"\n";
|| IsNewer('fmgrtab.c', '../../../src/include/access/transam.h'))
{
system(
-"perl -I ../catalog Gen_fmgrtab.pl -I../../../src/include/ $pg_language_dat $pg_proc_dat"
+ "perl -I ../catalog Gen_fmgrtab.pl -I../../../src/include/ $pg_language_dat $pg_proc_dat"
);
}
chdir('../../..');
{
print "Generating probes.h...\n";
system(
-'perl src/backend/utils/Gen_dummy_probes.pl src/backend/utils/probes.d > src/include/utils/probes.h'
+ 'perl src/backend/utils/Gen_dummy_probes.pl src/backend/utils/probes.d > src/include/utils/probes.h'
);
}
{
print "Generating spiexceptions.h...\n";
system(
-'perl src/pl/plpython/generate-spiexceptions.pl src/backend/utils/errcodes.txt > src/pl/plpython/spiexceptions.h'
+ 'perl src/pl/plpython/generate-spiexceptions.pl src/backend/utils/errcodes.txt > src/pl/plpython/spiexceptions.h'
);
}
{
print "Generating errcodes.h...\n";
system(
-'perl src/backend/utils/generate-errcodes.pl src/backend/utils/errcodes.txt > src/backend/utils/errcodes.h'
+ 'perl src/backend/utils/generate-errcodes.pl src/backend/utils/errcodes.txt > src/backend/utils/errcodes.h'
);
copyFile('src/backend/utils/errcodes.h',
'src/include/utils/errcodes.h');
{
print "Generating plerrcodes.h...\n";
system(
-'perl src/pl/plpgsql/src/generate-plerrcodes.pl src/backend/utils/errcodes.txt > src/pl/plpgsql/src/plerrcodes.h'
+ 'perl src/pl/plpgsql/src/generate-plerrcodes.pl src/backend/utils/errcodes.txt > src/pl/plpgsql/src/plerrcodes.h'
);
}
{
print "Generating pltclerrcodes.h...\n";
system(
-'perl src/pl/tcl/generate-pltclerrcodes.pl src/backend/utils/errcodes.txt > src/pl/tcl/pltclerrcodes.h'
+ 'perl src/pl/tcl/generate-pltclerrcodes.pl src/backend/utils/errcodes.txt > src/pl/tcl/pltclerrcodes.h'
);
}
{
print "Generating qsort_tuple.c...\n";
system(
-'perl src/backend/utils/sort/gen_qsort_tuple.pl > src/backend/utils/sort/qsort_tuple.c'
+ 'perl src/backend/utils/sort/gen_qsort_tuple.pl > src/backend/utils/sort/qsort_tuple.c'
);
}
my $obj = $dir;
$obj =~ s!/!_!g;
print $f
-"><FileConfiguration Name=\"Debug|$self->{platform}\"><Tool Name=\"VCCLCompilerTool\" ObjectFile=\".\\debug\\$self->{name}\\$obj"
+ "><FileConfiguration Name=\"Debug|$self->{platform}\"><Tool Name=\"VCCLCompilerTool\" ObjectFile=\".\\debug\\$self->{name}\\$obj"
. "_$file.obj\" /></FileConfiguration><FileConfiguration Name=\"Release|$self->{platform}\"><Tool Name=\"VCCLCompilerTool\" ObjectFile=\".\\release\\$self->{name}\\$obj"
. "_$file.obj\" /></FileConfiguration></File>\n";
}
if ($self->{disablelinkerwarnings})
{
print $f
-"\t\tAdditionalOptions=\"/ignore:$self->{disablelinkerwarnings}\"\n";
+ "\t\tAdditionalOptions=\"/ignore:$self->{disablelinkerwarnings}\"\n";
}
if ($self->{implib})
{
print $f "\t/>\n";
print $f
-"\t<Tool Name=\"VCLibrarianTool\" OutputFile=\".\\$cfgname\\$self->{name}\\$self->{name}.lib\" IgnoreDefaultLibraryNames=\"libc\" />\n";
+ "\t<Tool Name=\"VCLibrarianTool\" OutputFile=\".\\$cfgname\\$self->{name}\\$self->{name}.lib\" IgnoreDefaultLibraryNames=\"libc\" />\n";
print $f
-"\t<Tool Name=\"VCResourceCompilerTool\" AdditionalIncludeDirectories=\"src\\include\" />\n";
+ "\t<Tool Name=\"VCResourceCompilerTool\" AdditionalIncludeDirectories=\"src\\include\" />\n";
if ($self->{builddef})
{
print $f
-"\t<Tool Name=\"VCPreLinkEventTool\" Description=\"Generate DEF file\" CommandLine=\"perl src\\tools\\msvc\\gendef.pl $cfgname\\$self->{name} $self->{platform}\" />\n";
+ "\t<Tool Name=\"VCPreLinkEventTool\" Description=\"Generate DEF file\" CommandLine=\"perl src\\tools\\msvc\\gendef.pl $cfgname\\$self->{name} $self->{platform}\" />\n";
}
print $f <<EOF;
</Configuration>
foreach my $ref (@{ $self->{references} })
{
print $f
-" <ProjectReference ReferencedProjectIdentifier=\"$ref->{guid}\" Name=\"$ref->{name}\" />\n";
+ " <ProjectReference ReferencedProjectIdentifier=\"$ref->{guid}\" Name=\"$ref->{name}\" />\n";
}
print $f " </References>\n";
}
. $self->GenerateCustomTool($desc, $tool, $output, 'Release');
}
return
-"<FileConfiguration Name=\"$cfg|$self->{platform}\"><Tool Name=\"VCCustomBuildTool\" Description=\"$desc\" CommandLine=\"$tool\" AdditionalDependencies=\"\" Outputs=\"$output\" /></FileConfiguration>";
+ "<FileConfiguration Name=\"$cfg|$self->{platform}\"><Tool Name=\"VCCustomBuildTool\" Description=\"$desc\" CommandLine=\"$tool\" AdditionalDependencies=\"\" Outputs=\"$output\" /></FileConfiguration>";
}
package VC2005Project;
my $output = `nmake /? 2>&1`;
$? >> 8 == 0
or croak
-"Unable to determine Visual Studio version: The nmake command wasn't found.";
+ "Unable to determine Visual Studio version: The nmake command wasn't found.";
if ($output =~ /(\d+)\.(\d+)\.\d+(\.\d+)?$/m)
{
return _GetVisualStudioVersion($1, $2);
}
croak
-"Unable to determine Visual Studio version: The nmake version could not be determined.";
+ "Unable to determine Visual Studio version: The nmake version could not be determined.";
}
sub _GetVisualStudioVersion
if ($major > 14)
{
carp
-"The determined version of Visual Studio is newer than the latest supported version. Returning the latest supported version instead.";
+ "The determined version of Visual Studio is newer than the latest supported version. Returning the latest supported version instead.";
return '14.00';
}
elsif ($major < 6)
{
croak
-"Unable to determine Visual Studio version: Visual Studio versions before 6.0 aren't supported.";
+ "Unable to determine Visual Studio version: Visual Studio versions before 6.0 aren't supported.";
}
return "$major.$minor";
}
if ($buildwhat and $vcver >= 10.00)
{
system(
-"msbuild $buildwhat.vcxproj /verbosity:normal $msbflags /p:Configuration=$bconf"
+ "msbuild $buildwhat.vcxproj /verbosity:normal $msbflags /p:Configuration=$bconf"
);
}
elsif ($buildwhat)
else
{
system(
-"msbuild pgsql.sln /verbosity:normal $msbflags /p:Configuration=$bconf");
+ "msbuild pgsql.sln /verbosity:normal $msbflags /p:Configuration=$bconf"
+ );
}
# report status
system($cmd);
die "features_unsupported" if $?;
$cmd =
-"perl generate-errcodes-table.pl \"../../../src/backend/utils/errcodes.txt\" "
+ "perl generate-errcodes-table.pl \"../../../src/backend/utils/errcodes.txt\" "
. "> errcodes-table.sgml";
system($cmd);
die "errcodes-table" if $?;
my $what = shift || "";
if ($what =~
-/^(check|installcheck|plcheck|contribcheck|modulescheck|ecpgcheck|isolationcheck|upgradecheck|bincheck|recoverycheck|taptest)$/i
+ /^(check|installcheck|plcheck|contribcheck|modulescheck|ecpgcheck|isolationcheck|upgradecheck|bincheck|recoverycheck|taptest)$/i
)
{
$what = uc $what;
$top_builddir = $top_builddir . "/..";
}
$MAKECMD =
-"$MAKE -qp 'subdir=$subdir' 'top_builddir=$top_builddir' -f '$top_builddir/src/Makefile.global'";
+ "$MAKE -qp 'subdir=$subdir' 'top_builddir=$top_builddir' -f '$top_builddir/src/Makefile.global'";
}
my ($CPPFLAGS, $CFLAGS, $CFLAGS_SL, $PTHREAD_CFLAGS, $CC);
--entab-leading-whitespace=4
--keep-old-blank-lines=2
--maximum-line-length=78
+--nooutdent-long-quotes
--nospace-for-semicolon
--opening-brace-on-new-line
--output-line-ending=unix
# Our standard indent settings
my $indent_opts =
-"-bad -bap -bbb -bc -bl -cli1 -cp33 -cdb -nce -d0 -di12 -nfc1 -i4 -l79 -lp -lpl -nip -npro -sac -tpg -ts4";
+ "-bad -bap -bbb -bc -bl -cli1 -cp33 -cdb -nce -d0 -di12 -nfc1 -i4 -l79 -lp -lpl -nip -npro -sac -tpg -ts4";
my $devnull = File::Spec->devnull;
if (`$indent --version` !~ m/ $INDENT_VERSION$/)
{
print STDERR
-"You do not appear to have $indent version $INDENT_VERSION installed on your system.\n";
+ "You do not appear to have $indent version $INDENT_VERSION installed on your system.\n";
exit 1;
}
my $extern_c_start = '/* Open extern "C" */';
my $extern_c_stop = '/* Close extern "C" */';
$source =~
-s!(^#ifdef[ \t]+__cplusplus.*\nextern[ \t]+"C"[ \t]*\n)\{[ \t]*$!$1$extern_c_start!gm;
+ s!(^#ifdef[ \t]+__cplusplus.*\nextern[ \t]+"C"[ \t]*\n)\{[ \t]*$!$1$extern_c_start!gm;
$source =~ s!(^#ifdef[ \t]+__cplusplus.*\n)\}[ \t]*$!$1$extern_c_stop!gm;
# Protect wrapping in CATALOG()
open(my $fh, '<', "configure.in") || die "could not read configure.in: $!\n";
while (<$fh>)
{
- if (
-m/^m4_if\(m4_defn\(\[m4_PACKAGE_VERSION\]\), \[(.*)\], \[\], \[m4_fatal/)
+ if (m/^m4_if\(m4_defn\(\[m4_PACKAGE_VERSION\]\), \[(.*)\], \[\], \[m4_fatal/
+ )
{
$aconfver = $1;
last;
my $fixedfiles = "";
sed_file("configure.in",
-"-e 's/AC_INIT(\\[PostgreSQL\\], \\[[0-9a-z.]*\\]/AC_INIT([PostgreSQL], [$fullversion]/'"
+ "-e 's/AC_INIT(\\[PostgreSQL\\], \\[[0-9a-z.]*\\]/AC_INIT([PostgreSQL], [$fullversion]/'"
);
sed_file("doc/bug.template",
-"-e 's/PostgreSQL version (example: PostgreSQL .*) *: PostgreSQL .*/PostgreSQL version (example: PostgreSQL $fullversion): PostgreSQL $fullversion/'"
+ "-e 's/PostgreSQL version (example: PostgreSQL .*) *: PostgreSQL .*/PostgreSQL version (example: PostgreSQL $fullversion): PostgreSQL $fullversion/'"
);
sed_file("src/include/pg_config.h.win32",
-"-e 's/#define PACKAGE_STRING \"PostgreSQL .*\"/#define PACKAGE_STRING \"PostgreSQL $fullversion\"/' "
+ "-e 's/#define PACKAGE_STRING \"PostgreSQL .*\"/#define PACKAGE_STRING \"PostgreSQL $fullversion\"/' "
. "-e 's/#define PACKAGE_VERSION \".*\"/#define PACKAGE_VERSION \"$fullversion\"/' "
. "-e 's/#define PG_VERSION \".*\"/#define PG_VERSION \"$fullversion\"/' "
. "-e 's/#define PG_VERSION_NUM .*/#define PG_VERSION_NUM $padnumericversion/'"
);
sed_file("src/interfaces/libpq/libpq.rc.in",
-"-e 's/FILEVERSION [0-9]*,[0-9]*,[0-9]*,0/FILEVERSION $majorversion,0,$numericminor,0/' "
+ "-e 's/FILEVERSION [0-9]*,[0-9]*,[0-9]*,0/FILEVERSION $majorversion,0,$numericminor,0/' "
. "-e 's/PRODUCTVERSION [0-9]*,[0-9]*,[0-9]*,0/PRODUCTVERSION $majorversion,0,$numericminor,0/' "
. "-e 's/VALUE \"FileVersion\", \"[0-9.]*/VALUE \"FileVersion\", \"$numericversion/' "
. "-e 's/VALUE \"ProductVersion\", \"[0-9.]*/VALUE \"ProductVersion\", \"$numericversion/'"
);
sed_file("src/port/win32ver.rc",
-"-e 's/FILEVERSION [0-9]*,[0-9]*,[0-9]*,0/FILEVERSION $majorversion,0,$numericminor,0/' "
+ "-e 's/FILEVERSION [0-9]*,[0-9]*,[0-9]*,0/FILEVERSION $majorversion,0,$numericminor,0/' "
. "-e 's/PRODUCTVERSION [0-9]*,[0-9]*,[0-9]*,0/PRODUCTVERSION $majorversion,0,$numericminor,0/'"
);
if ($sys->{display} ne $file->{display})
{
print
-"Timezone $sys->{std} changed displayname ('$sys->{display}' from '$file->{display}')!\n";
+ "Timezone $sys->{std} changed displayname ('$sys->{display}' from '$file->{display}')!\n";
}
last;
}
for my $z (@add)
{
print
-"\t{\n\t\t\"$z->{std}\", \"$z->{dlt}\",\n\t\t\"FIXME\"\n\t},\t\t\t\t\t\t\t/* $z->{display} */\n";
+ "\t{\n\t\t\"$z->{std}\", \"$z->{dlt}\",\n\t\t\"FIXME\"\n\t},\t\t\t\t\t\t\t/* $z->{display} */\n";
}
}