Skip to content

Commit be6221e

Browse files
committed
Fix bug in pg_basebackup -F plain -R.
Commit caba97a changed pg_basebackup -F plain -R so that it overwrote postgresql.auto.conf in the backup, with new connection setting. This could cause the existing postgresql.auto.conf settings in the server to get lost unexpectedly. This is a bug. This commit fixes the bug by making pg_basebackup -F plain -R append the connection setting into postgresql.auto.conf in the backup. Author: Fujii Masao Reviewed-by: Sergei Kornilov Discussion: https://postgr.es/m/250dcf2a-94e7-c05e-824a-73cfb38a48a4@oss.nttdata.com
1 parent e49d5eb commit be6221e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/fe_utils/recovery_gen.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ WriteRecoveryConfig(PGconn *pgconn, char *target_dir, PQExpBuffer contents)
128128
snprintf(filename, MAXPGPATH, "%s/%s", target_dir,
129129
use_recovery_conf ? "recovery.conf" : "postgresql.auto.conf");
130130

131-
cf = fopen(filename, use_recovery_conf ? "a" : "w");
131+
cf = fopen(filename, use_recovery_conf ? "w" : "a");
132132
if (cf == NULL)
133133
{
134134
pg_log_error("could not open file \"%s\": %m", filename);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy