Re: ReplicationSlotRelease() crashes when the instance is in the single user mode

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>
Cc: "'pgsql-hackers(at)lists(dot)postgresql(dot)org'" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: ReplicationSlotRelease() crashes when the instance is in the single user mode
Date: 2025-02-20 00:02:19
Message-ID: Z7ZxC-xL7y_b6Yrs@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Sami Imseih 2025-02-20 00:32:44 Re: Sample rate added to pg_stat_statements
Previous Message Daniel Gustafsson 2025-02-19 23:56:56 Re: IPC::Run::time[r|out] vs our TAP tests