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 {
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 };
You can’t perform that action at this time.
0 commit comments