summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorRobert Haas2017-02-09 20:10:09 +0000
committerRobert Haas2017-02-09 20:10:09 +0000
commit806091c96f9b81f7631e4e37a05af377b473b5da (patch)
tree90235fbd665a13439225621e0c11a3980d7ee096 /src/test
parent72257f95781af97108fa9a9e7224ec81a90e7693 (diff)
Remove all references to "xlog" from SQL-callable functions in pg_proc.
Commit f82ec32ac30ae7e3ec7c84067192535b2ff8ec0e renamed the pg_xlog directory to pg_wal. To make things consistent, and because "xlog" is terrible terminology for either "transaction log" or "write-ahead log" rename all SQL-callable functions that contain "xlog" in the name to instead contain "wal". (Note that this may pose an upgrade hazard for some users.) Similarly, rename the xlog_position argument of the functions that create slots to be called wal_position. Discussion: https://www.postgresql.org/message-id/CA+Tgmob=YmA=H3DbW1YuOXnFVgBheRmyDkWcD9M8f=5bGWYEoQ@mail.gmail.com
Diffstat (limited to 'src/test')
-rw-r--r--src/test/modules/commit_ts/t/002_standby.pl8
-rw-r--r--src/test/modules/commit_ts/t/003_standby_2.pl4
-rw-r--r--src/test/perl/PostgresNode.pm10
-rw-r--r--src/test/recovery/t/002_archiving.pl6
-rw-r--r--src/test/recovery/t/003_recovery_targets.pl16
-rw-r--r--src/test/recovery/t/005_replay_delay.pl4
-rw-r--r--src/test/recovery/t/008_fsm_truncation.pl4
-rw-r--r--src/test/regress/expected/hs_standby_functions.out2
-rw-r--r--src/test/regress/sql/hs_primary_extremes.sql2
-rw-r--r--src/test/regress/sql/hs_primary_setup.sql2
-rw-r--r--src/test/regress/sql/hs_standby_functions.sql2
-rw-r--r--src/test/subscription/t/001_rep_changes.pl2
-rw-r--r--src/test/subscription/t/002_types.pl2
13 files changed, 32 insertions, 32 deletions
diff --git a/src/test/modules/commit_ts/t/002_standby.pl b/src/test/modules/commit_ts/t/002_standby.pl
index ff60044540..203b75d35b 100644
--- a/src/test/modules/commit_ts/t/002_standby.pl
+++ b/src/test/modules/commit_ts/t/002_standby.pl
@@ -31,9 +31,9 @@ my $master_ts = $master->safe_psql('postgres',
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()');
+ $master->safe_psql('postgres', 'select pg_current_wal_location()');
$standby->poll_query_until('postgres',
- qq{SELECT '$master_lsn'::pg_lsn <= pg_last_xlog_replay_location()})
+ qq{SELECT '$master_lsn'::pg_lsn <= pg_last_wal_replay_location()})
or die "slave never caught up";
my $standby_ts = $standby->safe_psql('postgres',
@@ -45,9 +45,9 @@ $master->append_conf('postgresql.conf', 'track_commit_timestamp = off');
$master->restart;
$master->safe_psql('postgres', 'checkpoint');
$master_lsn =
- $master->safe_psql('postgres', 'select pg_current_xlog_location()');
+ $master->safe_psql('postgres', 'select pg_current_wal_location()');
$standby->poll_query_until('postgres',
- qq{SELECT '$master_lsn'::pg_lsn <= pg_last_xlog_replay_location()})
+ qq{SELECT '$master_lsn'::pg_lsn <= pg_last_wal_replay_location()})
or die "slave never caught up";
$standby->safe_psql('postgres', 'checkpoint');
diff --git a/src/test/modules/commit_ts/t/003_standby_2.pl b/src/test/modules/commit_ts/t/003_standby_2.pl
index 1775b22dad..d7898b8355 100644
--- a/src/test/modules/commit_ts/t/003_standby_2.pl
+++ b/src/test/modules/commit_ts/t/003_standby_2.pl
@@ -30,9 +30,9 @@ $master->append_conf('postgresql.conf', 'track_commit_timestamp = off');
$master->restart;
$master->safe_psql('postgres', 'checkpoint');
my $master_lsn =
- $master->safe_psql('postgres', 'select pg_current_xlog_location()');
+ $master->safe_psql('postgres', 'select pg_current_wal_location()');
$standby->poll_query_until('postgres',
- qq{SELECT '$master_lsn'::pg_lsn <= pg_last_xlog_replay_location()})
+ qq{SELECT '$master_lsn'::pg_lsn <= pg_last_wal_replay_location()})
or die "slave never caught up";
$standby->safe_psql('postgres', 'checkpoint');
diff --git a/src/test/perl/PostgresNode.pm b/src/test/perl/PostgresNode.pm
index 18d5d12454..4018f0af1f 100644
--- a/src/test/perl/PostgresNode.pm
+++ b/src/test/perl/PostgresNode.pm
@@ -1358,11 +1358,11 @@ mode must be specified.
sub lsn
{
my ($self, $mode) = @_;
- my %modes = ('insert' => 'pg_current_xlog_insert_location()',
- 'flush' => 'pg_current_xlog_flush_location()',
- 'write' => 'pg_current_xlog_location()',
- 'receive' => 'pg_last_xlog_receive_location()',
- 'replay' => 'pg_last_xlog_replay_location()');
+ my %modes = ('insert' => 'pg_current_wal_insert_location()',
+ 'flush' => 'pg_current_wal_flush_location()',
+ 'write' => 'pg_current_wal_location()',
+ 'receive' => 'pg_last_wal_receive_location()',
+ 'replay' => 'pg_last_wal_replay_location()');
$mode = '<undef>' if !defined($mode);
die "unknown mode for 'lsn': '$mode', valid modes are " . join(', ', keys %modes)
diff --git a/src/test/recovery/t/002_archiving.pl b/src/test/recovery/t/002_archiving.pl
index fc2bf7ee1d..83b43bf84d 100644
--- a/src/test/recovery/t/002_archiving.pl
+++ b/src/test/recovery/t/002_archiving.pl
@@ -33,10 +33,10 @@ $node_standby->start;
$node_master->safe_psql('postgres',
"CREATE TABLE tab_int AS SELECT generate_series(1,1000) AS a");
my $current_lsn =
- $node_master->safe_psql('postgres', "SELECT pg_current_xlog_location();");
+ $node_master->safe_psql('postgres', "SELECT pg_current_wal_location();");
# Force archiving of WAL file to make it present on master
-$node_master->safe_psql('postgres', "SELECT pg_switch_xlog()");
+$node_master->safe_psql('postgres', "SELECT pg_switch_wal()");
# Add some more content, it should not be present on standby
$node_master->safe_psql('postgres',
@@ -44,7 +44,7 @@ $node_master->safe_psql('postgres',
# Wait until necessary replay has been done on standby
my $caughtup_query =
- "SELECT '$current_lsn'::pg_lsn <= pg_last_xlog_replay_location()";
+ "SELECT '$current_lsn'::pg_lsn <= pg_last_wal_replay_location()";
$node_standby->poll_query_until('postgres', $caughtup_query)
or die "Timed out while waiting for standby to catch up";
diff --git a/src/test/recovery/t/003_recovery_targets.pl b/src/test/recovery/t/003_recovery_targets.pl
index a82545bf6f..b7b0caae68 100644
--- a/src/test/recovery/t/003_recovery_targets.pl
+++ b/src/test/recovery/t/003_recovery_targets.pl
@@ -32,7 +32,7 @@ sub test_recovery_standby
# Wait until standby has replayed enough data
my $caughtup_query =
- "SELECT '$until_lsn'::pg_lsn <= pg_last_xlog_replay_location()";
+ "SELECT '$until_lsn'::pg_lsn <= pg_last_wal_replay_location()";
$node_standby->poll_query_until('postgres', $caughtup_query)
or die "Timed out while waiting for standby to catch up";
@@ -57,7 +57,7 @@ $node_master->start;
$node_master->safe_psql('postgres',
"CREATE TABLE tab_int AS SELECT generate_series(1,1000) AS a");
my $lsn1 =
- $node_master->safe_psql('postgres', "SELECT pg_current_xlog_location();");
+ $node_master->safe_psql('postgres', "SELECT pg_current_wal_location();");
# Take backup from which all operations will be run
$node_master->backup('my_backup');
@@ -67,14 +67,14 @@ $node_master->backup('my_backup');
$node_master->safe_psql('postgres',
"INSERT INTO tab_int VALUES (generate_series(1001,2000))");
my $ret = $node_master->safe_psql('postgres',
- "SELECT pg_current_xlog_location(), txid_current();");
+ "SELECT pg_current_wal_location(), txid_current();");
my ($lsn2, $recovery_txid) = split /\|/, $ret;
# More data, with recovery target timestamp
$node_master->safe_psql('postgres',
"INSERT INTO tab_int VALUES (generate_series(2001,3000))");
$ret = $node_master->safe_psql('postgres',
- "SELECT pg_current_xlog_location(), now();");
+ "SELECT pg_current_wal_location(), now();");
my ($lsn3, $recovery_time) = split /\|/, $ret;
# Even more data, this time with a recovery target name
@@ -82,22 +82,22 @@ $node_master->safe_psql('postgres',
"INSERT INTO tab_int VALUES (generate_series(3001,4000))");
my $recovery_name = "my_target";
my $lsn4 =
- $node_master->safe_psql('postgres', "SELECT pg_current_xlog_location();");
+ $node_master->safe_psql('postgres', "SELECT pg_current_wal_location();");
$node_master->safe_psql('postgres',
"SELECT pg_create_restore_point('$recovery_name');");
# And now for a recovery target LSN
$node_master->safe_psql('postgres',
"INSERT INTO tab_int VALUES (generate_series(4001,5000))");
-my $recovery_lsn = $node_master->safe_psql('postgres', "SELECT pg_current_xlog_location()");
+my $recovery_lsn = $node_master->safe_psql('postgres', "SELECT pg_current_wal_location()");
my $lsn5 =
- $node_master->safe_psql('postgres', "SELECT pg_current_xlog_location();");
+ $node_master->safe_psql('postgres', "SELECT pg_current_wal_location();");
$node_master->safe_psql('postgres',
"INSERT INTO tab_int VALUES (generate_series(5001,6000))");
# Force archiving of WAL file
-$node_master->safe_psql('postgres', "SELECT pg_switch_xlog()");
+$node_master->safe_psql('postgres', "SELECT pg_switch_wal()");
# Test recovery targets
my @recovery_params = ("recovery_target = 'immediate'");
diff --git a/src/test/recovery/t/005_replay_delay.pl b/src/test/recovery/t/005_replay_delay.pl
index 640295bfa8..cd9e8f5c12 100644
--- a/src/test/recovery/t/005_replay_delay.pl
+++ b/src/test/recovery/t/005_replay_delay.pl
@@ -42,7 +42,7 @@ $node_master->safe_psql('postgres',
# Now wait for replay to complete on standby. We're done waiting when the
# slave has replayed up to the previously saved master LSN.
my $until_lsn =
- $node_master->safe_psql('postgres', "SELECT pg_current_xlog_location()");
+ $node_master->safe_psql('postgres', "SELECT pg_current_wal_location()");
my $remaining = 90;
while ($remaining-- > 0)
@@ -50,7 +50,7 @@ while ($remaining-- > 0)
# Done waiting?
my $replay_status = $node_standby->safe_psql('postgres',
- "SELECT (pg_last_xlog_replay_location() - '$until_lsn'::pg_lsn) >= 0"
+ "SELECT (pg_last_wal_replay_location() - '$until_lsn'::pg_lsn) >= 0"
);
last if $replay_status eq 't';
diff --git a/src/test/recovery/t/008_fsm_truncation.pl b/src/test/recovery/t/008_fsm_truncation.pl
index 5220611e44..8aa8a4fe82 100644
--- a/src/test/recovery/t/008_fsm_truncation.pl
+++ b/src/test/recovery/t/008_fsm_truncation.pl
@@ -68,11 +68,11 @@ vacuum verbose testtab;
$node_master->psql('postgres', 'checkpoint');
my $until_lsn =
- $node_master->safe_psql('postgres', "SELECT pg_current_xlog_location();");
+ $node_master->safe_psql('postgres', "SELECT pg_current_wal_location();");
# Wait long enough for standby to receive and apply all WAL
my $caughtup_query =
- "SELECT '$until_lsn'::pg_lsn <= pg_last_xlog_replay_location()";
+ "SELECT '$until_lsn'::pg_lsn <= pg_last_wal_replay_location()";
$node_standby->poll_query_until('postgres', $caughtup_query)
or die "Timed out while waiting for standby to catch up";
diff --git a/src/test/regress/expected/hs_standby_functions.out b/src/test/regress/expected/hs_standby_functions.out
index 16d50a8285..e0af677ea1 100644
--- a/src/test/regress/expected/hs_standby_functions.out
+++ b/src/test/regress/expected/hs_standby_functions.out
@@ -15,7 +15,7 @@ select length(txid_current_snapshot()::text) >= 4;
select pg_start_backup('should fail');
ERROR: recovery is in progress
HINT: WAL control functions cannot be executed during recovery.
-select pg_switch_xlog();
+select pg_switch_wal();
ERROR: recovery is in progress
HINT: WAL control functions cannot be executed during recovery.
select pg_stop_backup();
diff --git a/src/test/regress/sql/hs_primary_extremes.sql b/src/test/regress/sql/hs_primary_extremes.sql
index 629efb4be5..2051e2e5cf 100644
--- a/src/test/regress/sql/hs_primary_extremes.sql
+++ b/src/test/regress/sql/hs_primary_extremes.sql
@@ -70,4 +70,4 @@ SELECT count(*) > 257 FROM pg_locks;
COMMIT;
SELECT hs_locks_drop(257);
-SELECT pg_switch_xlog();
+SELECT pg_switch_wal();
diff --git a/src/test/regress/sql/hs_primary_setup.sql b/src/test/regress/sql/hs_primary_setup.sql
index a00b367cbc..eeb4421307 100644
--- a/src/test/regress/sql/hs_primary_setup.sql
+++ b/src/test/regress/sql/hs_primary_setup.sql
@@ -22,4 +22,4 @@ insert into hs3 values (115);
DROP sequence if exists hsseq;
create sequence hsseq;
-SELECT pg_switch_xlog();
+SELECT pg_switch_wal();
diff --git a/src/test/regress/sql/hs_standby_functions.sql b/src/test/regress/sql/hs_standby_functions.sql
index 7577045f11..251bac0a43 100644
--- a/src/test/regress/sql/hs_standby_functions.sql
+++ b/src/test/regress/sql/hs_standby_functions.sql
@@ -10,7 +10,7 @@ select txid_current();
select length(txid_current_snapshot()::text) >= 4;
select pg_start_backup('should fail');
-select pg_switch_xlog();
+select pg_switch_wal();
select pg_stop_backup();
-- should return no rows
diff --git a/src/test/subscription/t/001_rep_changes.pl b/src/test/subscription/t/001_rep_changes.pl
index b51740bcd4..fa50e495a5 100644
--- a/src/test/subscription/t/001_rep_changes.pl
+++ b/src/test/subscription/t/001_rep_changes.pl
@@ -52,7 +52,7 @@ $node_subscriber->safe_psql('postgres',
# Wait for subscriber to finish initialization
my $caughtup_query =
-"SELECT pg_current_xlog_location() <= replay_location FROM pg_stat_replication WHERE application_name = '$appname';";
+"SELECT pg_current_wal_location() <= replay_location FROM pg_stat_replication WHERE application_name = '$appname';";
$node_publisher->poll_query_until('postgres', $caughtup_query)
or die "Timed out while waiting for subscriber to catch up";
diff --git a/src/test/subscription/t/002_types.pl b/src/test/subscription/t/002_types.pl
index 9064eb4c6d..f44e1e671d 100644
--- a/src/test/subscription/t/002_types.pl
+++ b/src/test/subscription/t/002_types.pl
@@ -107,7 +107,7 @@ $node_subscriber->safe_psql('postgres',
# Wait for subscriber to finish initialization
my $caughtup_query =
-"SELECT pg_current_xlog_location() <= replay_location FROM pg_stat_replication WHERE application_name = '$appname';";
+"SELECT pg_current_wal_location() <= replay_location FROM pg_stat_replication WHERE application_name = '$appname';";
$node_publisher->poll_query_until('postgres', $caughtup_query)
or die "Timed out while waiting for subscriber to catch up";