pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: AC Gomez <antklc@gmail.com>
Cc: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: what happens when you issue ALTER SERVER in a hot environment?
Date: Tue, 07 Apr 2020 00:53:11 -0400
Message-ID: <25511.1586235191@sss.pgh.pa.us> (raw)
In-Reply-To: <CAKFQuwY=XfZns9Yu9Uv9doytAK6Aws=z-jgVKB55todjAbAMyQ@mail.gmail.com>
References: <CABtmK-igRATivTYqPTbMUNmZssnXqZBVdFCPnWn=TPdnGaZE7g@mail.gmail.com>
	<CAKFQuwY=XfZns9Yu9Uv9doytAK6Aws=z-jgVKB55todjAbAMyQ@mail.gmail.com>

"David G. Johnston" <david.g.johnston@gmail.com> writes:
> On Monday, April 6, 2020, AC Gomez <antklc@gmail.com> wrote:
>> If you issue an  ALTER SERVER command and there are active connections
>> with that server in use or new ones are coming in, what happens? Docs on
>> this command say nothing regarding active processing using the server
>> context and changes to it. So I assume it's just handled.

> Not sure if there are exceptions but assume that nothing external will
> change your current active session’s settings out from underneath you.

Couple of comments here:

* ALTER SERVER changes nothing until "pg_ctl reload" or similar is
issued.  The same goes for manually editing the config file (which
is more or less the same thing, though on a different file).

* Once you do issue a reload, individual sessions will adopt the
new setting reasonably promptly, though not necessarily all at the
same instant (assuming it's a setting that doesn't require a
postmaster restart to take effect, in which case nothing happens).

* A session that has a higher-priority source for the setting of
a given GUC, such as a locally-issued SET, is not going to adopt
the new setting from the config file.  But it *will* adopt that
setting on-the-fly if it has no other source of the setting.
The priority rules are explained in the fine manual, IIRC.
Possibly some clarification is needed?

>> For example if you alter user/password, I assume that as long as prior
>> user password is still good that actively running processes will keep going.

> If you alter a password the old one is by definition no longer good...but
> it doesn’t matter because authentication only happens once - during login.

Right.  Also, passwords are *not* managed through the GUC (server
parameter) mechanism; what I just said about GUCs doesn't apply
to them.

			regards, tom lane





view thread (5+ messages)  latest in thread

Message-ID: <25511.1586235191@sss.pgh.pa.us>
Permalink:  ../25511.1586235191@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/25511.1586235191@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, david.g.johnston@gmail.com, antklc@gmail.com
  Subject: Re: what happens when you issue ALTER SERVER in a hot environment?
  In-Reply-To: <25511.1586235191@sss.pgh.pa.us>
  References: <CABtmK-igRATivTYqPTbMUNmZssnXqZBVdFCPnWn=TPdnGaZE7g@mail.gmail.com> <CAKFQuwY=XfZns9Yu9Uv9doytAK6Aws=z-jgVKB55todjAbAMyQ@mail.gmail.com> <25511.1586235191@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