Re: [PATCH] Add ALTER SYSTEM RELOAD - Mailing list pgsql-hackers

From Chao Li
Subject Re: [PATCH] Add ALTER SYSTEM RELOAD
Date
Msg-id 2A827F6B-F99F-4735-B9A3-5753BDD54263@gmail.com
Whole thread
In response to [PATCH] Add ALTER SYSTEM RELOAD  (Yuhang Qiu <iamqyh@gmail.com>)
Responses Re: [PATCH] Add ALTER SYSTEM RELOAD
List pgsql-hackers

> On Sep 24, 2026, at 17:35, Michael Banck <mbanck@gmx.net> wrote:
>
> Hi,
>
> On Thu, Sep 24, 2026 at 03:39:22PM +0800, Chao Li wrote:
>> Is there a reason ALTER SYSTEM RELOAD needs stronger privileges than
>> pg_reload_conf()?
>
> Well, it is clear that you won't be able to GRANT this on a SQL-level.
>
> But what could be done is add the pg_maintain (or something similar)
> default role as an allowed user for running this command besides
> Superuser.
>
>
> Michael


Yeah, that could be a solution. But the current patch only allows super user:
```
+/*
+ * Execute ALTER SYSTEM RELOAD.
+ */
+void
+AlterSystemReloadConfig(void)
+{
+    if (!AllowAlterSystem)
+        ereport(ERROR,
+                (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+                 errmsg("ALTER SYSTEM is not allowed in this environment")));
+
+    if (!superuser())
+        ereport(ERROR,
+                (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
+                 errmsg("permission denied to perform ALTER SYSTEM RELOAD")));
+
+    if (kill(PostmasterPid, SIGHUP))
+        ereport(ERROR,
+                (errmsg("failed to send signal to postmaster: %m")));
+}
```

That’s what I got the concern.

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/







pgsql-hackers by date:

Previous
From: Xuneng Zhou
Date:
Subject: Re: Logical slot creation/synchronization on a standby may deadlock with recovery conflict resolution
Next
From: Nisha Moond
Date:
Subject: Re: Fix "unexpected logical decoding status change" error; from concurrent logical decoding activation