From a714e9775b7f64d84b25b61ee4b36eee8423b3d3 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Thu, 8 Apr 2021 17:30:36 +0200 Subject: [PATCH] Fix the recovery script for postgres >= 12. --- templates/pgpool_recovery_stage_1.j2 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/templates/pgpool_recovery_stage_1.j2 b/templates/pgpool_recovery_stage_1.j2 index 14011ad..771e460 100644 --- a/templates/pgpool_recovery_stage_1.j2 +++ b/templates/pgpool_recovery_stage_1.j2 @@ -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"