Re: Docs: Clarify that SIGHUP/reload does not update all GUCs for existing sessions

From: Balkrishna Pandey <balkrishna(dot)pandey(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-docs(at)lists(dot)postgresql(dot)org
Subject: Re: Docs: Clarify that SIGHUP/reload does not update all GUCs for existing sessions
Date: 2026-01-14 06:57:54
Message-ID: CAEdRop0j8cnDHhg26D8sSCu_FVfApcytsSiwKAfHubyHFji9qA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-docs

Hi Tom,

Thanks , that is a helpful framing, and I agree my first suggestion went
too deep into GUC “context” details and still didn’t capture the full rule
(e.g., session-level SET overriding postgresql.conf).

What I was trying to address is the impression a reader may get from “so
that existing sessions also adopt the new values,” namely that *all*
changed settings automatically take effect everywhere.

Based on your explanation, I think the doc should state the behavior at the
“source of active value” level:

-

On SIGHUP, backends re-read postgresql.conf
-

A backend will only see a changed value take effect if it was previously
using the value from postgresql.conf
-

If the active value came from elsewhere (e.g., a SET in the session,
ALTER ROLE/DATABASE, etc.), then nothing changes in that session

Would something like the following be closer to the right level of
complexity?

-

The main server process also propagates this signal to all currently
running server processes, so that existing sessions also adopt the new
values (this will happen after they complete any currently-executing client
command).

-

The main server process also propagates this signal to all currently
running server processes. After completing any currently-executing command,
existing sessions re-read postgresql.conf and will adopt changed values for
parameters where their active setting was coming from postgresql.conf. If a
session’s active value was set from another source (for example, a SET
command or role/database settings), the session’s behavior will not change.

Does this phrasing align with what you had in mind? I appreciate your
feedback

Thanks in advance!

Regards,

Balkrishna

On Wed, Jan 14, 2026 at 12:17 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Balkrishna Pandey <balkrishna(dot)pandey(at)gmail(dot)com> writes:
> > *Proposed wording (illustrative diff):*
>
> > *+ The main server process also propagates this signal to all currently
> > running server processes.+ Existing sessions will adopt new values for
> > parameters whose context allows changes at reload+ time (for example,
> > sighup). Parameters whose context is backend or superuser-backend do not+
> > change within an already-started session; changes to those only affect
> > subsequently-launched+ sessions.*
>
> This seems to me to be getting way too far into the implementation weeds,
> while still failing to cover everything. For example, it's also true
> that a SET within the session will override postgresql.conf.
>
> The main intent of the code is that SIGHUP will propagate a
> postgresql.conf change into an existing session if that session
> had been using the previous value from postgresql.conf. If its
> source for the active value was something else, nothing changes.
> You can argue about whether "backend"-context GUCs are an exception
> to that rule, but I think our statement in the docs should be
> about at that level of complexity.
>
> regards, tom lane
>

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message David G. Johnston 2026-01-14 14:10:03 Re: Docs: Clarify that SIGHUP/reload does not update all GUCs for existing sessions
Previous Message Tom Lane 2026-01-14 06:47:11 Re: Docs: Clarify that SIGHUP/reload does not update all GUCs for existing sessions