Re: Invalid primary_slot_name triggers warnings in all processes on reload

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Invalid primary_slot_name triggers warnings in all processes on reload
Date: 2025-09-23 04:23:55
Message-ID: CAA4eK1LirTDOzdMwq_0EBoQyqRdfiARSa6K=DKPossWk_rsGfg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Sep 19, 2025 at 12:00 PM Fujii Masao <masao(dot)fujii(at)gmail(dot)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.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2025-09-23 04:25:16 Re: issue with synchronized_standby_slots
Previous Message Pavel Stehule 2025-09-23 04:11:21 Re: [PATCH] Introduce unified support for composite GUC options