We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent845db08 commitbdecedbCopy full SHA for bdecedb
t/001_wal.pl
@@ -13,10 +13,23 @@ sub test_index_replay
13
{
14
my ($test_name) =@_;
15
16
+# Check server version
17
+my$server_version =$node_master->safe_psql("postgres","SELECT current_setting('server_version_num');") + 0;
18
+
19
# Wait for standby to catch up
20
my$applname =$node_standby->name;
-my$caughtup_query =
-"SELECT pg_current_wal_lsn() <= write_lsn FROM pg_stat_replication WHERE application_name = '$applname';";
21
+my$caughtup_query;
22
23
+if ($server_version < 100000)
24
+{
25
+$caughtup_query =
26
+"SELECT pg_current_xlog_location() <= write_location FROM pg_stat_replication WHERE application_name = '$applname';";
27
+}
28
+else
29
30
31
+"SELECT pg_current_wal_lsn() <= write_lsn FROM pg_stat_replication WHERE application_name = '$applname';";
32
33
$node_master->poll_query_until('postgres',$caughtup_query)
34
ordie"Timed out while waiting for standby 1 to catch up";
35