From: Stephen Frost <sfrost@snowman.net>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Ian Barwick <ian.barwick@2ndquadrant.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Tomas Vondra <tomas.vondra@2ndquadrant.com>
Cc: Amit Kapila <amit.kapila16@gmail.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: [PATCH] Stop ALTER SYSTEM from making bad assumptions
Date: Wed, 21 Aug 2019 12:25:22 -0400
Message-ID: <20190821162521.GD16436@tamriel.snowman.net> (raw)
In-Reply-To: <29770.1565810142@sss.pgh.pa.us>
References: <30823.1565030571@sss.pgh.pa.us>
<CA+TgmobRpgiqCZ_FMUeDW4RM1W+RzT4HA2xSQy=QMcfv=X47jw@mail.gmail.com>
<32103.1565032053@sss.pgh.pa.us>
<20190806005225.GM29202@tamriel.snowman.net>
<6cba0dff-485b-6781-d659-0a376b966c89@2ndquadrant.com>
<20190806021616.GP29202@tamriel.snowman.net>
<54620b18-60b7-4b9b-7d1d-90a6464ab333@2ndquadrant.com>
<5879.1565121423@sss.pgh.pa.us>
<20190806214355.GA29202@tamriel.snowman.net>
<29770.1565810142@sss.pgh.pa.us>
Greetings,
* Tom Lane (tgl@sss.pgh.pa.us) wrote:
> + <para>
> + External tools may also
> + modify <filename>postgresql.auto.conf</filename>. It is not
> + recommended to do this while the server is running, since a
> + concurrent <command>ALTER SYSTEM</command> command could overwrite
> + such changes. Such tools might simply append new settings to the end,
> + or they might choose to remove duplicate settings and/or comments
> + (as <command>ALTER SYSTEM</command> will).
> </para>
While I don't know that we necessairly have to change this langauge, I
did want to point out for folks who look at these things and consider
the challenges of this change that simply appending, when it comes to
things like backup tools and such, is just not going to work, since
you'll run into things like this:
FATAL: multiple recovery targets specified
DETAIL: At most one of recovery_target, recovery_target_lsn, recovery_target_name, recovery_target_time, recovery_target_xid may be set.
That's from simply doing a backup, restore with one recovery target,
then back that up and restore with a different recovery target.
Further there's the issue that if you specify a recovery target for the
first restore and then *don't* have one for the second restore, then
you'll still end up trying to restore to the first point... So,
basically, appending just isn't actually practical for what is probably
the most common use-case these days for an external tool to go modify
postgresql.auto.conf.
And so, every backup tool author that lets a user specify a target
during the restore to generate the postgresql.auto.conf with (formerly
recovery.conf) is going to have to write enough of a parser for PG
config files to be able to find and comment or remove any recovery
target options from postgresql.auto.conf.
That'd be the kind of thing that I was really hoping we could provide a
common library for.
Thanks,
Stephen
Attachments:
signature.asc (application/pgp-signature, 818B) download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: sfrost@snowman.net, tgl@sss.pgh.pa.us, ian.barwick@2ndquadrant.com, robertmhaas@gmail.com, tomas.vondra@2ndquadrant.com, amit.kapila16@gmail.com
Subject: Re: [PATCH] Stop ALTER SYSTEM from making bad assumptions
In-Reply-To: <20190821162521.GD16436@tamriel.snowman.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox