Fix the recovery script for postgres >= 12.

This commit is contained in:
Andrea Dell'Amico 2021-04-08 17:30:36 +02:00
parent 8e390d20f0
commit a714e9775b
1 changed files with 5 additions and 0 deletions

View File

@ -44,6 +44,11 @@ logger "pgpool_recovery_1: backup of the database from $MASTER_HOST to $RECOVERY
# Configure the restore_command to use the archive_log WALs we will copy
# over in 2nd_stage.sh.
{% if psql_version >= 12 %}
echo "restore_command = 'cp $RECOVERY_DATA/archive_log/%f %p'" | ssh -T $RECOVERY_TARGET "cat >> $RECOVERY_DATA/postgresql.auto.conf"
ssh -T "$RECOVERY_TARGET" "touch $RECOVERY_DATA/recovery.signal"
{% else %}
echo "restore_command = 'cp $RECOVERY_DATA/archive_log/%f %p'" | ssh -T $RECOVERY_TARGET "cat > $RECOVERY_DATA/recovery.conf"
{% endif %}
logger "pgpool_recovery_1: create the restore command on $RECOVERY_TARGET"