Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1huflQ-0001TK-Ne for pgsql-hackers@arkaria.postgresql.org; Mon, 05 Aug 2019 16:23:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hufkP-0007ka-D4 for pgsql-hackers@arkaria.postgresql.org; Mon, 05 Aug 2019 16:22:09 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hufkO-0007jf-QV for pgsql-hackers@lists.postgresql.org; Mon, 05 Aug 2019 16:22:08 +0000 Received: from xvm-110-146.dc2.ghst.net ([46.226.110.146] helo=fetter.org) by makus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1hufkL-0007ih-MJ for pgsql-hackers@postgresql.org; Mon, 05 Aug 2019 16:22:07 +0000 Received: by fetter.org (Postfix, from userid 1001) id C93E940998; Mon, 5 Aug 2019 18:22:03 +0200 (CEST) Date: Mon, 5 Aug 2019 18:22:03 +0200 From: David Fetter To: Ian Barwick Cc: Tom Lane , Tomas Vondra , Andres Freund , Stephen Frost , Amit Kapila , Robert Haas , "pgsql-hackers@postgresql.org" Subject: Re: [PATCH] Stop ALTER SYSTEM from making bad assumptions Message-ID: <20190805162203.GR31493@fetter.org> References: <31697.1564784856@sss.pgh.pa.us> <32681.1564786027@sss.pgh.pa.us> <20190803004558.jfkbngi6g64eaqku@alap3.anarazel.de> <20190803010802.rs3cz2kjq4dl4olu@alap3.anarazel.de> <20190803124111.2aaddumd7url5wmq@development> <16320.1564851579@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Mon, Aug 05, 2019 at 03:52:07PM +0900, Ian Barwick wrote: > On 8/4/19 1:59 AM, Tom Lane wrote:> Tomas Vondra writes: > >> On Fri, Aug 02, 2019 at 06:08:02PM -0700, Andres Freund wrote: > >>> We're WAY WAY past feature freeze. This isn't the time to rewrite guc.c, > >>> guc-file.l to be suitable for running outside of a backend environment. > > > >> Right. And even if we had the code, it's not quite backpatchable (which > >> we probably should do, considering this is a general ALTER SYSTEM issue, > >> so not pg12-only). > > > >> Not to mention there's no clear consensus this is actually desirable. > >> I'd argue forcing external tools (written in arbitrary language) to use > >> this library (written in C), just to modify a "stupid" text file is a > >> bit overkill. IMO duplicates don't make the file invalid, we should > >> handle that correctly/gracefully, so I don't see why external tools > >> could not simply append to the file. We can deduplicate the file when > >> starting the server, on ALTER SYSTEM, or some other time. > > > > Yup. I'd also point out that even if we had a command-line tool of this > > sort, there would be scenarios where it's not practical or not convenient > > to use. We need not go further than "my tool needs to work with existing > > PG releases" to think of good examples. > > I suspect this hasn't been an issue before, simply because until the removal > of recovery.conf AFAIK there hasn't been a general use-case where you'd need > to modify pg.auto.conf while the server is not running. The use-case which now > exists (i.e. for writing replication configuration) is one where the tool will > need to be version-aware anyway (like pg_basebackup is), so I don't see that as > a particular deal-breaker. > > But... > > > I think we should just accept the facts on the ground, which are that > > some tools modify pg.auto.conf by appending to it > > +1. It's just a text file... So are crontab and /etc/passwd, but there are gizmos that help make it difficult for people to write complete gobbledygook to those. Does it make sense to discuss tooling of that type? Best, David. -- David Fetter http://fetter.org/ Phone: +1 415 235 3778 Remember to vote! Consider donating to Postgres: http://www.postgresql.org/about/donate