Re: Avoid a possible null pointer (src/backend/utils/adt/pg_locale.c) - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Avoid a possible null pointer (src/backend/utils/adt/pg_locale.c)
Date
Msg-id ZQEjG0mnKRtOPCdO@paquier.xyz
Whole thread Raw
In response to Re: Avoid a possible null pointer (src/backend/utils/adt/pg_locale.c)  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Responses Re: Avoid a possible null pointer (src/backend/utils/adt/pg_locale.c)
List pgsql-hackers
On Wed, Sep 13, 2023 at 09:59:22AM +0900, Kyotaro Horiguchi wrote:
> At Tue, 12 Sep 2023 09:03:27 +0900, Michael Paquier <michael@paquier.xyz> wrote in
> > On Mon, Sep 11, 2023 at 12:15:49PM -0700, Jeff Davis wrote:
> > > That's fine with me.
> >
> > Okay.  Then, please find attached a v4 for HEAD and REL_16_STABLE.
>
> For example, they result in the following message:
>
> ERROR:  unsupported collprovider (pg_strcoll): i
>
> Even if it is an elog message, I believe we can make it clearer. The
> pg_strcoll seems like a collation privier at first glance. Not sure
> about others, though, I would spell it as the follows instead:
>
> ERROR:  unsupported collprovider in pg_strcoll: i
> ERROR:  unsupported collprovider in pg_strcoll(): i

Hmm.  I see your point, one could be confused that the function name
is the provider with this wording.  How about that instead:
 ERROR:  unsupported collprovider for %s: %c

I've hidden that in a macro that uses __func__ as Jeff has suggested.

What do you think?
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Hongxu Ma
Date:
Subject: Re: PSQL error: total cell count of XXX exceeded
Next
From: Michael Paquier
Date:
Subject: Re: Add 'worker_type' to pg_stat_subscription