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

Ranier Vilela <ranier.vf@gmail.com>

From: Ranier Vilela <ranier.vf@gmail.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Robert Haas <robertmhaas@gmail.com>, Pg Hackers <pgsql-hackers@postgresql.org>, Jeff Davis <pgsql@j-davis.com>
Date: 2023-09-10T21:28:08Z
Lists: pgsql-hackers

Attachments

Em sex., 8 de set. de 2023 às 03:24, Michael Paquier <michael@paquier.xyz>
escreveu:

> On Wed, Sep 06, 2023 at 07:57:03AM -0300, Ranier Vilela wrote:
> > I think no one objected.
>
> Looking closer, there is much more inconsistency in this file
> depending on the routine called.  How about something like the v2
> attached instead to provide more context in the error message about
> the function called?

+1
But as Jeff mentioned, when the locale is NULL,
the provider is known to be COLLPROVIDER_LIBC.

I think we can use this to provide an error message,
when the locale is NULL.

What do you think about v3 attached?

best regards,
Ranier Vilela

Commits

  1. Refactor error messages for unsupported providers in pg_locale.c