Re: ReplicationSlotRelease() crashes when the instance is in the single user mode - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: ReplicationSlotRelease() crashes when the instance is in the single user mode
Date
Msg-id Z7ZxC-xL7y_b6Yrs@paquier.xyz
Whole thread Raw
In response to ReplicationSlotRelease() crashes when the instance is in the single user mode  ("Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>)
Responses RE: ReplicationSlotRelease() crashes when the instance is in the single user mode
List pgsql-hackers
On Wed, Feb 19, 2025 at 02:57:34AM +0000, Hayato Kuroda (Fujitsu) wrote:
> Based on the discussion, I feel it is enough to add quick error out
> for SQL functions. PSA attached.

I did not check how these call behave individually, just a few
comments while putting my eyes on the patch.

+    if (!IsUnderPostmaster)
+        elog(ERROR,
+             "slot operation is prohibited in the single user mode");

elog() should not be used for failures that can be user-facing as this
would not provide any translation.

I'd suggest rewording the error message to provide some more context,
as well, say:
"cannot use %s in single-user mode", "function_name"
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Daniel Gustafsson
Date:
Subject: Re: IPC::Run::time[r|out] vs our TAP tests
Next
From: Sami Imseih
Date:
Subject: Re: Sample rate added to pg_stat_statements