Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1x9p8J-00000002FGy-1EgJ for pgsql-hackers@arkaria.postgresql.org; Thu, 24 Sep 2026 19:29:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1x9p8H-0000000EDuH-0wTu for pgsql-hackers@arkaria.postgresql.org; Thu, 24 Sep 2026 19:29:25 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1x9p8G-0000000EDu9-3D9A for pgsql-hackers@lists.postgresql.org; Thu, 24 Sep 2026 19:29:24 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1x9p8E-000000015A1-0QHH for pgsql-hackers@postgresql.org; Thu, 24 Sep 2026 19:29:23 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.18.1/8.18.1) with ESMTP id 68OJTKJ21811099; Thu, 24 Sep 2026 15:29:20 -0400 From: Tom Lane To: Chao Li cc: Yuhang Qiu , PostgreSQL-development Subject: Re: [PATCH] Add ALTER SYSTEM RELOAD In-reply-to: References: <5A1F1E3B-D22F-487B-9480-D3DDB5F0C2A1@gmail.com> Comments: In-reply-to Chao Li message dated "Thu, 24 Sep 2026 15:39:22 +0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1811097.1790278160.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 24 Sep 2026 15:29:20 -0400 Message-ID: <1811098.1790278160@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Chao Li writes: >> On Sep 23, 2026, at 17:44, Yuhang Qiu wrote: >> For configuration parameters that can be reloaded, administrators often= need >> to perform two steps in succession: >> ```sql >> ALTER SYSTEM SET work_mem =3D '64MB'; >> SELECT pg_reload_conf(); >> ``` >> = >> I propose adding `ALTER SYSTEM RELOAD`, so the sequence can be written = as: >> ```sql >> ALTER SYSTEM SET work_mem =3D '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 e= ssentially 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: ALTER SYSTEM - change a server configuration parameter + change or reload the server configuration 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