Re: Invalid primary_slot_name triggers warnings in all processes on reload - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: Invalid primary_slot_name triggers warnings in all processes on reload
Date
Msg-id CAA4eK1LirTDOzdMwq_0EBoQyqRdfiARSa6K=DKPossWk_rsGfg@mail.gmail.com
Whole thread Raw
In response to Re: Invalid primary_slot_name triggers warnings in all processes on reload  (Fujii Masao <masao.fujii@gmail.com>)
List pgsql-hackers
On Fri, Sep 19, 2025 at 12:00 PM Fujii Masao <masao.fujii@gmail.com> wrote:
>
> So I agree it's safer to free them explicitly. In the attached updated patch,
> ReplicationSlotValidateName() now pfrees err_msg and err_hint when needed.
>

+error:
+ if (elevel == 0)
+ {
+ GUC_check_errdetail("%s", err_msg);
+ if (err_hint != NULL)
+ GUC_check_errhint("%s", err_hint);

I see that other places use GUC_check_errcode. See
check_synchronous_standby_names. So, shouldn't we use it here as well?

I don't see any other place distinguishing GUC related errors in this
way. It seems the other way to differentiate throwing errors for GUC
related messages is used in call_string_check_hook and friends. It may
not be used as it is but it can give some ideas to explore. I have not
explored in detail so it may not be relevant here but it is worth
checking once.

--
With Regards,
Amit Kapila.



pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: [PATCH] Introduce unified support for composite GUC options
Next
From: Amit Kapila
Date:
Subject: Re: issue with synchronized_standby_slots