From: Ian Barwick <ian.barwick@2ndquadrant.com>
To: Andres Freund <andres@anarazel.de>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Stephen Frost <sfrost@snowman.net>
Cc: Amit Kapila <amit.kapila16@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Tomas Vondra <tomas.vondra@2ndquadrant.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: [PATCH] Stop ALTER SYSTEM from making bad assumptions
Date: Sat, 3 Aug 2019 08:22:29 +0900
Message-ID: <e61fca0f-7ea7-d8bf-6230-a35e8f9a0911@2ndquadrant.com> (raw)
In-Reply-To: <20190802225640.gm7bhwkgctzje4su@alap3.anarazel.de>
References: <CA+TgmoZVx-vco-39EN9MxO9BaG-oVY+NuDeZPGdS=_bX5VH70w@mail.gmail.com>
<20190624185647.GW2480@tamriel.snowman.net>
<15032.1561403529@sss.pgh.pa.us>
<20190624192014.GB2480@tamriel.snowman.net>
<56aff4f3-dec8-f462-7feb-0938411b04a6@2ndquadrant.com>
<CAA4eK1+JMm=tvx720y6jhD8pdzt=HdS1-TwQwkARib2pwK8EvQ@mail.gmail.com>
<20190802222254.qsvqjtkwte464lu3@development>
<31697.1564784856@sss.pgh.pa.us>
<CAOuzzgqNyQM_z0biEEBVBK9WcaLmbCyWrd5xTdf-Oxb_9pntLA@mail.gmail.com>
<32681.1564786027@sss.pgh.pa.us>
<20190802225640.gm7bhwkgctzje4su@alap3.anarazel.de>
On 8/3/19 7:56 AM, Andres Freund wrote:
> Hi,
>
> On 2019-08-02 18:47:07 -0400, Tom Lane wrote:
>> Stephen Frost <sfrost@snowman.net> writes:
>>> I disagree that this should only be addressed in alter system, as I’ve said
>>> before and as others have agreed with. Having one set of code that can be
>>> used to update parameters in the auto.conf and then have that be used by
>>> pg_basebackup, alter system, and external tools, is the right approach.
>>
>> I don't find that to be necessary or even desirable. Many (most?) of the
>> situations where this would be important wouldn't have access to a running
>> backend, and maybe not to any PG code at all --- what if your tool isn't
>> written in C?
>
> I think a commandline tool to perform the equivalent of ALTER SYSTEM on
> a shutdown cluster would be a great tool. It's easy enough to add
> something with broken syntax, and further down the road such a tool
> could not only ensure the syntax is correct, but also validate
> individual settings as much as possible (obviously there's some hairy
> issues here).
What I came up with shoehorned a stripped-down version of the backend
config parser into fe_utils and provides a function to modify pg.auto.conf
in much the same way ALTER SYSTEM does, but with only the basic syntax
checking provided by the parser of course. And for completeness a
client utility which can be called by scripts etc.
I can clean it up and submit it later for reference (got distracted by other things
recently) though I don't think it's a particularly good solution due to the
lack of actual checks for the provided GUCSs (and the implementation
is ugly anyway); something like what Andres suggests below would be far better.
> Quite possibly the most realistic way to implement something like that
> would be a postgres commandline switch, which'd start up far enough to
> perform GUC checks and execute AlterSystem(), and then shut down
> again. We already have -C, I think such an option could reasonably be
> implemented alongside it.
>
> Obviously this is widely out of scope for v12.
Regards
Ian Barwick
--
Ian Barwick https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
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: ian.barwick@2ndquadrant.com, andres@anarazel.de, tgl@sss.pgh.pa.us, sfrost@snowman.net, amit.kapila16@gmail.com, robertmhaas@gmail.com, tomas.vondra@2ndquadrant.com
Subject: Re: [PATCH] Stop ALTER SYSTEM from making bad assumptions
In-Reply-To: <e61fca0f-7ea7-d8bf-6230-a35e8f9a0911@2ndquadrant.com>
* 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