From: Tom Lane <tgl@sss.pgh.pa.us>
To: Chao Li <li.evan.chao@gmail.com>
Cc: Yuhang Qiu <iamqyh@gmail.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: [PATCH] Add ALTER SYSTEM RELOAD
Date: Thu, 24 Sep 2026 15:29:20 -0400
Message-ID: <1811098.1790278160@sss.pgh.pa.us> (raw)
In-Reply-To: <B254502B-2BF5-4A17-BA04-1E4AA6D878B3@gmail.com>
References: <5A1F1E3B-D22F-487B-9480-D3DDB5F0C2A1@gmail.com>
<B254502B-2BF5-4A17-BA04-1E4AA6D878B3@gmail.com>
Chao Li <li.evan.chao@gmail.com> writes:
>> On Sep 23, 2026, at 17:44, Yuhang Qiu <iamqyh@gmail.com> wrote:
>> For configuration parameters that can be reloaded, administrators often need
>> to perform two steps in succession:
>> ```sql
>> ALTER SYSTEM SET work_mem = '64MB';
>> SELECT pg_reload_conf();
>> ```
>>
>> I propose adding `ALTER SYSTEM RELOAD`, so the sequence can be written as:
>> ```sql
>> ALTER SYSTEM SET work_mem = '64MB';
>> ALTER SYSTEM RELOAD;
>> ```
> Thanks for the patch. After reading it, I have a concern. pg_reload_conf() relies on normal function privileges, so a super user can grant EXECUTE on it to a non-superuser. With this patch, the two interfaces for doing essentially the same thing would have different privilege models:
I'm pretty down on this proposal even without the privilege question.
"There's more than one way to do it" isn't a great thing for
security-relevant operations, and this surely is one.
Also, I don't like the loss of an explainable scope for what
ALTER SYSTEM does. I see the patch changes the command's summary
like so:
<refname>ALTER SYSTEM</refname>
- <refpurpose>change a server configuration parameter</refpurpose>
+ <refpurpose>change or reload the server configuration</refpurpose>
which is entirely not self-consistent. (For one thing, it implies
that you can change any part of the server's configuration through
this command, which is not so: stuff like pg_hba.conf remains out
of scope.)
This lack of intellectual consistency would get ten times worse
if we followed through on the idea of overloading ALTER SYSTEM
with unrelated actions like log rotation and promotion.
The reason ALTER SYSTEM exists, IMO, is to re-use the infrastructure
we had for SET and RESET commands to allow alteration of GUC values
system-wide as well as locally in a session. It does not exist for
discoverability.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, li.evan.chao@gmail.com, iamqyh@gmail.com
Subject: Re: [PATCH] Add ALTER SYSTEM RELOAD
In-Reply-To: <1811098.1790278160@sss.pgh.pa.us>
References: <5A1F1E3B-D22F-487B-9480-D3DDB5F0C2A1@gmail.com> <B254502B-2BF5-4A17-BA04-1E4AA6D878B3@gmail.com> <1811098.1790278160@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox