On Fri, Sep 19, 2025 at 12:00 PM Fujii Masao <masao.fu...@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.