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

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Avoid a possible null pointer (src/backend/utils/adt/pg_locale.c)
Дата
Msg-id ZPq+HKWh8fQ05/5U@paquier.xyz
обсуждение исходный текст
Ответ на Re: Avoid a possible null pointer (src/backend/utils/adt/pg_locale.c)  (Ranier Vilela <ranier.vf@gmail.com>)
Ответы Re: Avoid a possible null pointer (src/backend/utils/adt/pg_locale.c)  (Jeff Davis <pgsql@j-davis.com>)
Re: Avoid a possible null pointer (src/backend/utils/adt/pg_locale.c)  (Ranier Vilela <ranier.vf@gmail.com>)
Список pgsql-hackers
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?  Let's say, when the provider is known, we could
use:
+       elog(ERROR, "unsupported collprovider (%s): %c",
+            "pg_strncoll", locale->provider);

And when the provider is not known, we could use:
+       elog(ERROR, "unsupported collprovider (%s)", "pg_myfunc");

@Jeff (added now in CC), the refactoring done in d87d548c seems to be
at the origin of this confusion, because, before this commit, we never
generated this specific error for all these APIs where the locale is
undefined.  What is your take here?
--
Michael

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Amit Kapila
Дата:
Сообщение: Re: persist logical slots to disk during shutdown checkpoint
Следующее
От: Amit Kapila
Дата:
Сообщение: Re: Impact of checkpointer during pg_upgrade