Adjust recovery control function names for PG > 10

This commit is contained in:
Benjamin Renard 2020-11-04 15:16:39 +01:00 committed by root
parent 50c3363cbc
commit ea72d09399

View file

@ -213,11 +213,15 @@ REPLAY_CRITICAL_DELAY = $REPLAY_CRITICAL_DELAY
# Set some stuff to PostgreSQL version
if [ $( echo "$PG_VERSION < 10" |bc -l ) -eq 1 ]
then
pg_last_wal_receive_lsn='pg_last_xlog_receive_location()'
pg_last_wal_replay_lsn='pg_last_xlog_replay_location()'
pg_current_wal_lsn='pg_current_xlog_location()'
pg_wal_lsn_diff='pg_xlog_location_diff'
sent_lsn='sent_location'
write_lsn='write_location'
else
pg_last_wal_receive_lsn='pg_last_wal_receive_lsn()'
pg_last_wal_replay_lsn='pg_last_wal_replay_lsn()'
pg_current_wal_lsn='pg_current_wal_lsn()'
pg_wal_lsn_diff='pg_wal_lsn_diff'
sent_lsn='sent_lsn'
@ -253,9 +257,9 @@ then
fi
debug "Postgres is in recovery mode"
LAST_XLOG_RECEIVE=$( psql_get "SELECT pg_last_xlog_receive_location()" )
LAST_XLOG_RECEIVE=$( psql_get "SELECT $pg_last_wal_receive_lsn" )
debug "Last xlog file receive : $LAST_XLOG_RECEIVE"
LAST_XLOG_REPLAY=$( psql_get "SELECT pg_last_xlog_replay_location()" )
LAST_XLOG_REPLAY=$( psql_get "SELECT $pg_last_wal_replay_lsn" )
debug "Last xlog file replay : $LAST_XLOG_REPLAY"