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 1huiKa-0006yl-LG for pgsql-hackers@arkaria.postgresql.org; Mon, 05 Aug 2019 19:07:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1huiKY-0007H1-VS for pgsql-hackers@arkaria.postgresql.org; Mon, 05 Aug 2019 19:07:38 +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 1huiKY-0007ER-JD for pgsql-hackers@lists.postgresql.org; Mon, 05 Aug 2019 19:07:38 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1huiKV-00010I-6l for pgsql-hackers@postgresql.org; Mon, 05 Aug 2019 19:07:36 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x75J7XrE032104; Mon, 5 Aug 2019 15:07:33 -0400 From: Tom Lane To: Robert Haas cc: Stephen Frost , Tomas Vondra , Amit Kapila , Ian Barwick , "pgsql-hackers@postgresql.org" Subject: Re: [PATCH] Stop ALTER SYSTEM from making bad assumptions In-reply-to: References: <15032.1561403529@sss.pgh.pa.us> <20190624192014.GB2480@tamriel.snowman.net> <56aff4f3-dec8-f462-7feb-0938411b04a6@2ndquadrant.com> <20190802222254.qsvqjtkwte464lu3@development> <31697.1564784856@sss.pgh.pa.us> <20190802230011.dqokdhjptykopxxc@development> <20190805142139.GW29202@tamriel.snowman.net> <20190805172935.GK29202@tamriel.snowman.net> <30179.1565029753@sss.pgh.pa.us> <30823.1565030571@sss.pgh.pa.us> Comments: In-reply-to Robert Haas message dated "Mon, 05 Aug 2019 14:43:51 -0400" MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0" Content-ID: <32050.1565031993.0@sss.pgh.pa.us> Date: Mon, 05 Aug 2019 15:07:33 -0400 Message-ID: <32103.1565032053@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk ------- =_aaaaaaaaaa0 Content-Type: text/plain; charset="us-ascii" Content-ID: <32050.1565031993.1@sss.pgh.pa.us> Robert Haas writes: > On Mon, Aug 5, 2019 at 2:42 PM Tom Lane wrote: >> I don't think we need to go on about it at great length, but it seems >> to me that it'd be reasonable to point out that (a) you'd be well >> advised not to touch the file while the postmaster is up, and (b) >> last setting wins. Those things are equally true of postgresql.conf >> of course, but I don't recall whether they're already documented. > OK, fair enough. Concretely, how about the attached? (Digging around in config.sgml, I found that last-one-wins is stated, but only in the context of one include file overriding another. That's not *directly* a statement about what happens within a single file, and it's in a different subsection anyway, so repeating the info in 19.1.2 doesn't seem unreasonable.) regards, tom lane ------- =_aaaaaaaaaa0 Content-Type: text/x-diff; name="doc-handling-of-config-file-dup-entries.patch"; charset="us-ascii" Content-ID: <32050.1565031993.2@sss.pgh.pa.us> Content-Description: doc-handling-of-config-file-dup-entries.patch Content-Transfer-Encoding: quoted-printable diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index cdc30fa..f5986b2 100644 --- a/doc/src/sgml/config.sgml +++ b/doc/src/sgml/config.sgml @@ -153,6 +153,8 @@ shared_buffers =3D 128MB identifiers or numbers must be single-quoted. To embed a single quote in a parameter value, write either two quotes (preferred) or backslash-quote. + If the file contains multiple entries for the same parameter, + all but the last one are ignored. = @@ -185,18 +187,27 @@ shared_buffers =3D 128MB In addition to postgresql.conf, a PostgreSQL data directory contains a fi= le postgresql.auto.confpostgre= sql.auto.conf, - which has the same format as postgresql.conf bu= t should - never be edited manually. This file holds settings provided through - the command. This file is autom= atically - read whenever postgresql.conf is, and its setti= ngs take - effect in the same way. Settings in postgresql.auto.conf<= /filename> - override those in postgresql.conf. + which has the same format as postgresql.conf bu= t + is intended to be edited automatically not manually. This file hold= s + settings provided through the co= mmand. + This file is read whenever postgresql.conf is, + and its settings take effect in the same way. Settings + in postgresql.auto.conf override those + in postgresql.conf. + + + + External tools might also + modify postgresql.auto.conf, typically by appen= ding + new settings to the end. It is not recommended to do this while the + server is running, since a concurrent ALTER SYSTEM + command could overwrite such changes. = The system view pg_file_settings= - can be helpful for pre-testing changes to the configuration file, or= for + can be helpful for pre-testing changes to the configuration files, o= r for diagnosing problems if a SIGHUP signal did = not have the desired effects. ------- =_aaaaaaaaaa0--