File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -5111,7 +5111,12 @@ sub check_hot_standby_delay {
5111
5111
my ($moffset , $s_rec_offset , $s_rep_offset , $time_delta );
5112
5112
5113
5113
# # 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
+ }
5115
5120
if ($version >= 9.1) {
5116
5121
$SQL .= q{ , COALESCE(ROUND(EXTRACT(epoch FROM now() - pg_last_xact_replay_timestamp())),0) AS seconds} ;
5117
5122
}
@@ -5141,7 +5146,12 @@ sub check_hot_standby_delay {
5141
5146
}
5142
5147
5143
5148
# # 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
+ }
5145
5155
$info = run_command($SQL , { dbnumber => $master });
5146
5156
for $db (@{$info -> {db }}) {
5147
5157
my $location = $db -> {slurp }[0]{location };
You can’t perform that action at this time.
0 commit comments