pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Stephen Frost <sfrost@snowman.net>
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, 14 Aug 2019 15:15:42 -0400
Message-ID: <29770.1565810142@sss.pgh.pa.us> (raw)
In-Reply-To: <20190806214355.GA29202@tamriel.snowman.net>
References: <30179.1565029753@sss.pgh.pa.us>
	<CA+TgmoYEQyLE8Mtgko9-WSVWm=hLNGi3FO4xNLTrLpwi2GgPHw@mail.gmail.com>
	<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>

Stephen Frost <sfrost@snowman.net> writes:
> * Tom Lane (tgl@sss.pgh.pa.us) wrote:
>> Perhaps we could put some of these details into the Notes section of the
>> ALTER SYSTEM ref page.  But I wonder how much of this is needed at all.

> I'd be alright with that too, but I'd be just as fine with even a README
> or something that we feel other hackers and external tool developers
> would be likely to find.  I agree that all of this isn't something that
> your run-of-the-mill DBA needs to know, but they are things that I'm
> sure external tool authors will care about (including myself, David S,
> probably the other backup/restore tool maintainers, and at least the
> author of pg_conftool, presumably).

In hopes of moving this along, I've pushed Ian's last code change,
as there seems to be no real argument about that anymore.

As for the doc changes, how about the attached revision of what
I wrote previously?  It gives some passing mention to what ALTER
SYSTEM will do, without belaboring it or going into things that
are really implementation details.

As an example of the sort of implementation detail that I *don't*
want to document, I invite you to experiment with the difference
between
	ALTER SYSTEM SET TimeZone = 'America/New_York';
	ALTER SYSTEM SET "TimeZone" = 'America/New_York';

			regards, tom lane

Attachments:

doc-alter-system-better-2.patch (text/x-diff, 2.6K) download diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index cdc30fa..e99482d 100644 --- a/doc/src/sgml/config.sgml +++ b/doc/src/sgml/config.sgml @@ -153,6 +153,8 @@ shared_buffers = 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. </para> <para> @@ -185,18 +187,29 @@ shared_buffers = 128MB In addition to <filename>postgresql.conf</filename>, a <productname>PostgreSQL</productname> data directory contains a file <filename>postgresql.auto.conf</filename><indexterm><primary>postgresql.auto.conf</primary></indexterm>, - which has the same format as <filename>postgresql.conf</filename> but should - never be edited manually. This file holds settings provided through - the <xref linkend="sql-altersystem"/> command. This file is automatically - read whenever <filename>postgresql.conf</filename> is, and its settings take - effect in the same way. Settings in <filename>postgresql.auto.conf</filename> - override those in <filename>postgresql.conf</filename>. + which has the same format as <filename>postgresql.conf</filename> but + is intended to be edited automatically not manually. This file holds + settings provided through the <xref linkend="sql-altersystem"/> command. + This file is read whenever <filename>postgresql.conf</filename> is, + and its settings take effect in the same way. Settings + in <filename>postgresql.auto.conf</filename> override those + in <filename>postgresql.conf</filename>. + </para> + + <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> <para> The system view <link linkend="view-pg-file-settings"><structname>pg_file_settings</structname></link> - can be helpful for pre-testing changes to the configuration file, or for + can be helpful for pre-testing changes to the configuration files, or for diagnosing problems if a <systemitem>SIGHUP</systemitem> signal did not have the desired effects. </para>

view thread (117+ messages)  latest in thread

Message-ID: <29770.1565810142@sss.pgh.pa.us>
Permalink:  ../29770.1565810142@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/29770.1565810142@sss.pgh.pa.us

 ·  · 

reply

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: tgl@sss.pgh.pa.us, sfrost@snowman.net, 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: <29770.1565810142@sss.pgh.pa.us>

* 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