From: Laurenz Albe <laurenz.albe@cybertec.at>
To: 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 08:59:34 +0200
Message-ID: <ee1abd2bb29f91cfd0ee5c32bf1cf979b49aec68.camel@cybertec.at> (raw)
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>
On Tue, 2020-04-07 at 00:53 -0400, Tom Lane wrote:
> "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.
I think you both mixed up ALTER SYSTEM and ALTER SERVER.
The details of when exactly an ALTER SERVER will affect a query that uses
a foreign table on the server will vary depending on the implementation
of the foreign data wrapper, but typically the settings that were in effect
when the query was *planned* will be the ones used.
Typically, queries are planned right before they are executed. Any query
that is currently executing will continue to do so, but queries planned
after the ALTER SERVER will use the new values.
Sometimes plans are cached, but all cached plans that involve the changed
server will be invalidated and re-planned after the ALTER SERVER.
Yours,
Laurenz Albe
--
Cybertec | https://www.cybertec-postgresql.com
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: laurenz.albe@cybertec.at, 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: <ee1abd2bb29f91cfd0ee5c32bf1cf979b49aec68.camel@cybertec.at>
References: <CABtmK-igRATivTYqPTbMUNmZssnXqZBVdFCPnWn=TPdnGaZE7g@mail.gmail.com> <CAKFQuwY=XfZns9Yu9Uv9doytAK6Aws=z-jgVKB55todjAbAMyQ@mail.gmail.com> <25511.1586235191@sss.pgh.pa.us> <ee1abd2bb29f91cfd0ee5c32bf1cf979b49aec68.camel@cybertec.at>
* 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