Re: what happens when you issue ALTER SERVER in a hot environment? - Mailing list pgsql-general

From Laurenz Albe
Subject Re: what happens when you issue ALTER SERVER in a hot environment?
Date
Msg-id ee1abd2bb29f91cfd0ee5c32bf1cf979b49aec68.camel@cybertec.at
Whole thread Raw
In response to Re: what happens when you issue ALTER SERVER in a hot environment?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: what happens when you issue ALTER SERVER in a hot environment?
List pgsql-general
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




pgsql-general by date:

Previous
From: Konireddy Rajashekar
Date:
Subject: Re: Logical replication
Next
From: Laurenz Albe
Date:
Subject: Re: How to prevent master server crash if hot standby stops