]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Refactor error messages for unsupported providers in pg_locale.c
authorMichael Paquier <michael@paquier.xyz>
Wed, 13 Sep 2023 23:35:06 +0000 (08:35 +0900)
committerMichael Paquier <michael@paquier.xyz>
Wed, 13 Sep 2023 23:35:06 +0000 (08:35 +0900)
commit800d5bcb982b096a71438f36b8b22a3b5b557aa9
treed2c684f311a13638328d8e05b5625b0e97504c88
parent1a6900e58ae2c61b84b516901985e405b9d457b7
Refactor error messages for unsupported providers in pg_locale.c

These code paths should not be reached normally, but if they are an
error with "(null)" as information for the collation provider would show
up if no locale is set, while we can assume that we are referring to
libc.

This refactors the code so as the provider is always reported even if no
locale is set.  The name of the function where the error happens is
added, while on it, as it can be helpful for debugging.

Issue introduced by d87d548cd030, so backpatch down to 16.

Author: Michael Paquier, Ranier Vilela
Reviewed-by: Jeff Davis, Kyotaro Horiguchi
Discussion: https://postgr.es/m/7073610042fcf97e1bea2ce08b7e0214b5e11094.camel@j-davis.com
Backpatch-through: 16
src/backend/utils/adt/pg_locale.c