Re: Avoid a possible null pointer (src/backend/utils/adt/pg_locale.c)

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
Cc: pgsql(at)j-davis(dot)com, ranier(dot)vf(at)gmail(dot)com, robertmhaas(at)gmail(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Avoid a possible null pointer (src/backend/utils/adt/pg_locale.c)
Date: 2023-09-13 02:48:59
Message-ID: ZQEjG0mnKRtOPCdO@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)paquier(dot)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 Content-Type Size
pglocale-elogs-v5.patch text/x-diff 3.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2023-09-13 03:04:58 Re: Add 'worker_type' to pg_stat_subscription
Previous Message Hongxu Ma 2023-09-13 02:22:48 Re: PSQL error: total cell count of XXX exceeded