@@ -937,6 +937,7 @@ create_recovery_conf(time_t backup_id,
937937 /* construct restore_command */
938938 if (pitr_requested )
939939 {
940+ fio_fprintf (fp , "\n## recovery settings\n" );
940941 /* If restore_command is provided, use it. Otherwise construct it from scratch. */
941942 if (restore_command_provided )
942943 sprintf (restore_command_guc , "%s" , instance_config .restore_command );
@@ -1012,21 +1013,25 @@ create_recovery_conf(time_t backup_id,
10121013 fio_fprintf (fp , "recovery_target_action = '%s'\n" , "pause" );
10131014 }
10141015
1016+ if (pitr_requested )
1017+ {
1018+ elog (LOG , "Setting restore_command to '%s'" , restore_command_guc );
1019+ fio_fprintf (fp , "restore_command = '%s'\n" , restore_command_guc );
1020+ }
1021+
10151022 if (params -> restore_as_replica )
10161023 {
1024+ fio_fprintf (fp , "\n## standby settings\n" );
10171025 /* standby_mode was removed in PG12 */
10181026#if PG_VERSION_NUM < 120000
10191027 fio_fprintf (fp , "standby_mode = 'on'\n" );
10201028#endif
10211029
10221030 if (backup -> primary_conninfo )
10231031 fio_fprintf (fp , "primary_conninfo = '%s'\n" , backup -> primary_conninfo );
1024- }
10251032
1026- if (pitr_requested )
1027- {
1028- elog (LOG , "Setting restore_command to '%s'" , restore_command_guc );
1029- fio_fprintf (fp , "restore_command = '%s'\n" , restore_command_guc );
1033+ if (params -> primary_slot_name != NULL )
1034+ fio_fprintf (fp , "primary_slot_name = '%s'\n" , params -> primary_slot_name );
10301035 }
10311036
10321037 if (fio_fflush (fp ) != 0 ||
0 commit comments