pg_basebackup -F plain -R overwrites postgresql.auto.conf

Fujii Masao <masao.fujii@oss.nttdata.com>

From: Fujii Masao <masao.fujii@oss.nttdata.com>
To: pgsql-hackers@postgresql.org
Date: 2020-02-10T07:58:56Z
Lists: pgsql-hackers

Attachments

Hi,

I found that pg_basebackup -F plain -R *overwrites* postgresql.auto.conf
taken from the primary server with new primary_conninfo setting,
while pg_basebackup -F tar -R just *appends* it into the file. I think that
this is a bug and pg_basebackup -F plain -R should *append* the setting.
Thought?

I attached the patch to fix the bug. This patch should be back-patch to
v12.

Regards,

-- 
Fujii Masao
NTT DATA CORPORATION
Advanced Platform Technology Group
Research and Development Headquarters

Commits

  1. Fix bug in pg_basebackup -F plain -R.

  2. Split out recovery confing-writing code from pg_basebackup