Skip to content

Commit 97b47a7

Browse files
author
David Christensen
authored
Merge pull request bucardo#124 from uu/master
Support check_hot_standby_delay for PG10
2 parents ca1f541 + 5ade2a3 commit 97b47a7

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

check_postgres.pl

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5111,7 +5111,12 @@ sub check_hot_standby_delay {
51115111
my ($moffset, $s_rec_offset, $s_rep_offset, $time_delta);
51125112

51135113
## On slave
5114-
$SQL = q{SELECT pg_last_xlog_receive_location() AS receive, pg_last_xlog_replay_location() AS replay};
5114+
if ($version >= 10) {
5115+
$SQL = q{SELECT pg_last_wal_receive_lsn() AS receive, pg_last_wal_replay_lsn() AS replay};
5116+
}
5117+
else {
5118+
$SQL = q{SELECT pg_last_xlog_receive_location() AS receive, pg_last_xlog_replay_location() AS replay};
5119+
}
51155120
if ($version >= 9.1) {
51165121
$SQL .= q{, COALESCE(ROUND(EXTRACT(epoch FROM now() - pg_last_xact_replay_timestamp())),0) AS seconds};
51175122
}
@@ -5141,7 +5146,12 @@ sub check_hot_standby_delay {
51415146
}
51425147

51435148
## On master
5144-
$SQL = q{SELECT pg_current_xlog_location() AS location};
5149+
if ($version >= 10) {
5150+
$SQL = q{SELECT pg_current_wal_lsn() AS location};
5151+
}
5152+
else {
5153+
$SQL = q{SELECT pg_current_xlog_location() AS location};
5154+
}
51455155
$info = run_command($SQL, { dbnumber => $master });
51465156
for $db (@{$info->{db}}) {
51475157
my $location = $db->{slurp}[0]{location};

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy