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

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
Cc: Sergei Kornilov <sk(at)zsrv(dot)org>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_basebackup -F plain -R overwrites postgresql.auto.conf
Date: 2020-02-10 12:35:29
Message-ID: CABUevEyZQrAz+9Aw2WOWBRuvDxzMR=Vk7FgVS6rg3349H1MzDg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Feb 10, 2020 at 9:41 AM Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com> wrote:
>
>
>
> On 2020/02/10 17:23, Sergei Kornilov wrote:
> > Hello
> >
> > Seems bug was introduced in caba97a9d9f4d4fa2531985fd12d3cd823da06f3 - in HEAD only
> >
> > In REL_12_STABLE we have:
> >
> > bool is_recovery_guc_supported = true;
> >
> > if (PQserverVersion(conn) < MINIMUM_VERSION_FOR_RECOVERY_GUC)
> > is_recovery_guc_supported = false;
> >
> > snprintf(filename, MAXPGPATH, "%s/%s", basedir,
> > is_recovery_guc_supported ? "postgresql.auto.conf" : "recovery.conf");
> >
> > cf = fopen(filename, is_recovery_guc_supported ? "a" : "w");
> >
> > It looks correct: append mode for postgresql.auto.conf
> >
> > In HEAD version is_recovery_guc_supported variable was replaced to inversed use_recovery_conf without change fopen mode.
>
> Yes! Thanks for pointing out that!
> So the patch needs to be applied only in master.

+1. We should absolutely not be overwriting the auto conf.

--
Magnus Hagander
Me: https://www.hagander.net/
Work: https://www.redpill-linpro.com/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Arseny Sher 2020-02-10 13:04:46 Re: ERROR: subtransaction logged without previous top-level txn record
Previous Message Ranier Vilela 2020-02-10 12:13:35 Re: Postgres 32 bits client compilation fail. Win32 bits client is supported?