Hi,

On Thu, Oct 29, 2026, Jehan-Guillaume de Rorthais wrote:
> Please, find in attachment a patch fixing the later incoherence, and returning
> -1 instead of 0 if a GUC in config file is overridden by any mean when
> prohibitValueChange applies.

I agree the error for a value overridden on the command line is
misleading.  But skipping the check whenever the current source has
higher priority than the file also covers PGC_S_OVERRIDE, and that is
what auto-tuned parameters use at startup when they are set in the
file (wal_buffers, transaction_buffers, subtransaction_buffers,
commit_timestamp_buffers, io_max_concurrency).

For those, a change in the file does matter, because the override is
recomputed from the file at the next start.  With v1 applied to
master, I set them to auto in postgresql.conf, restarted, then changed
transaction_buffers from 0 to 64, io_max_concurrency from -1 to 8 and
wal_buffers from -1 to 1024 and reloaded.  pending_restart stayed f
for all three and there was no "cannot be changed without restarting"
message, only "setting ignored because previous source is higher
priority", although a restart would change all three values.  Without
the patch, wal_buffers is reported correctly today.

A command-line value, on the other hand, is still in effect after a
restart, so ignoring the file there seems right.  Would it work to
limit the new branch to record->source == PGC_S_ARGV (or at least
exclude PGC_S_OVERRIDE)?

The auto-tuned parameters have a separate false positive of their own
(unchanged settings reported as pending restart after every reload),
which I posted a fix for in the check hooks here:
https://postgr.es/m/CAFK+_hc=w86cqxmgrgcaejxnf3ug9r-bsna5dadw29kl4dj...@mail.gmail.com
Your patch happens to hide that one too, which is how I came across it.

Regards,
Jiho Lee


Reply via email to