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

From: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Avoid a possible null pointer (src/backend/utils/adt/pg_locale.c)
Date: 2023-09-06 10:57:03
Message-ID: CAEudQArof7O73ntXrQMnuRcwMhpN5POOAMz4-aHdT+Di3oqMVw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Em seg., 4 de set. de 2023 às 11:27, Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
escreveu:

> Em dom., 3 de set. de 2023 às 22:01, Michael Paquier <michael(at)paquier(dot)xyz>
> escreveu:
>
>> On Sat, Sep 02, 2023 at 09:13:11AM -0300, Ranier Vilela wrote:
>> > I tried to keep the same behavior as before.
>> > Note that if the locale equals COLLPROVIDER_LIBC,
>> > the message to the user will be the same.
>>
>> - /* shouldn't happen */
>> - elog(ERROR, "unsupported collprovider: %c", locale->provider);
>> + elog(ERROR, "collprovider '%c' does not support
>> pg_strnxfrm_prefix()",
>> + locale->provider);
>>
>> Based on what's written here, these messages could be better because
>> full sentences are not encouraged in error messages, even for
>> non-translated elogs:
>> https://www.postgresql.org/docs/current/error-style-guide.html
>>
>> Perhaps something like "could not use collprovider %c: no support for
>> %s", where the function name is used, would be more consistent.
>>
> Sure.
> I have no objection to the wording of the message.
> If there is consensus, I can send another patch.
>
I think no one objected.

v1 attached.

best regards,
Ranier Vilela

Attachment Content-Type Size
v1-0001-Avoid-a-possible-dereference-a-null-pointer.patch application/octet-stream 2.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message vignesh C 2023-09-06 10:58:39 Re: pg_upgrade and logical replication
Previous Message jacktby jacktby 2023-09-06 10:50:54 Re: How to add a new pg oid?