Search Postgresql Archives

Re: what happens when you issue ALTER SERVER in a hot environment?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thank you for clarifying. Don't you think this is pertinent information that should be in the ALTER SERVER doc page?

On Tue, Apr 7, 2020, 2:59 AM Laurenz Albe <laurenz.albe@xxxxxxxxxxx> wrote:
On Tue, 2020-04-07 at 00:53 -0400, Tom Lane wrote:
> "David G. Johnston" <david.g.johnston@xxxxxxxxx> writes:
> > On Monday, April 6, 2020, AC Gomez <antklc@xxxxxxxxx> 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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux