public inbox for [email protected]  
help / color / mirror / Atom feed
From: Michael Paquier <[email protected]>
To: Ranier Vilela <[email protected]>
Cc: Robert Haas <[email protected]>
Cc: Pg Hackers <[email protected]>
Subject: Re: Avoid a possible null pointer (src/backend/utils/adt/pg_locale.c)
Date: Mon, 4 Sep 2023 10:01:43 +0900
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAEudQAr6uCWQq2F-3pPJ+RO7btn4Mrr8opno-Cs-56wby0CQkQ@mail.gmail.com>
References: <CAEudQApjNNJz-uSTa1WYueWntSLD7sA=_0BXgSt6acFTFwudoA@mail.gmail.com>
	<CA+TgmoZiu5HUd1GmM3qtrxVNA2mb-9ZbVmoRxS=usRe+gFmOow@mail.gmail.com>
	<CAEudQAr6uCWQq2F-3pPJ+RO7btn4Mrr8opno-Cs-56wby0CQkQ@mail.gmail.com>

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.
--
Michael


Attachments:

  [application/pgp-signature] signature.asc (833B, ../[email protected]/2-signature.asc)
  download

view thread (7+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Avoid a possible null pointer (src/backend/utils/adt/pg_locale.c)
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox