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"