From: | AC Gomez <antklc(at)gmail(dot)com> |
---|---|
To: | Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at> |
Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org> |
Subject: | Re: what happens when you issue ALTER SERVER in a hot environment? |
Date: | 2020-04-07 13:16:37 |
Message-ID: | CABtmK-h+OfQCYdPbwcaqzaeCjG10y5s1E+eOUe-gvsfAnpDz=Q@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
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(dot)albe(at)cybertec(dot)at> wrote:
> On Tue, 2020-04-07 at 00:53 -0400, Tom Lane wrote:
> > "David G. Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> writes:
> > > On Monday, April 6, 2020, AC Gomez <antklc(at)gmail(dot)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
>
>
From | Date | Subject | |
---|---|---|---|
Next Message | Andreas Kretschmer | 2020-04-07 13:46:31 | Re: PostgreSQL native multi-master |
Previous Message | Vano Beridze | 2020-04-07 11:39:27 | PostgreSQL native multi-master |