Skip to content

Commit 196d4fa

Browse files
committed
bugfix: do not create empty recovery.conf
1 parent 186fb72 commit 196d4fa

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/restore.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1379,6 +1379,16 @@ update_recovery_options_before_v12(pgBackup *backup,
13791379
FILE *fp;
13801380
char path[MAXPGPATH];
13811381

1382+
/*
1383+
* If PITR is not requested and instance is not restored as replica,
1384+
* then recovery.conf should not be created.
1385+
*/
1386+
if (params->recovery_settings_mode != PITR_REQUESTED &&
1387+
!params->restore_as_replica)
1388+
{
1389+
return;
1390+
}
1391+
13821392
elog(LOG, "update recovery settings in recovery.conf");
13831393
snprintf(path, lengthof(path), "%s/recovery.conf", instance_config.pgdata);
13841394

0 commit comments

Comments
 (0)