Re: pgsql: Introduce "builtin" collation provider.

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: pgsql: Introduce "builtin" collation provider.
Дата
Msg-id 4ea13583-7305-40b0-8525-58381533e2b1@eisentraut.org
обсуждение исходный текст
Ответ на pgsql: Introduce "builtin" collation provider.  (Jeff Davis <jdavis@postgresql.org>)
Ответы Re: pgsql: Introduce "builtin" collation provider.  (Jeff Davis <pgsql@j-davis.com>)
Список pgsql-committers
On 14.03.24 07:39, Jeff Davis wrote:
> Introduce "builtin" collation provider.

Jeff,

I think I found a small bug in this commit.

The new code in dbcommands.c createdb() reads like this:

+   /* validate provider-specific parameters */
+   if (dblocprovider != COLLPROVIDER_BUILTIN)
+   {
+       if (dbuiltinlocale)
+           ereport(ERROR,
+                   (errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
+                    errmsg("BUILTIN_LOCALE cannot be specified unless 
locale provider is builtin")));
+   }
+   else if (dblocprovider != COLLPROVIDER_ICU)
+   {
+       if (diculocale)
+           ereport(ERROR,
+                   (errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
+                    errmsg("ICU locale cannot be specified unless 
locale provider is ICU")));
+
+       if (dbicurules)
+           ereport(ERROR,
+                   (errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
+                    errmsg("ICU rules cannot be specified unless locale 
provider is ICU")));
+   }

But if dblocprovider is COLLPROVIDER_LIBC, then the first "if" is true 
and the second one won't be checked.  I think the correct code structure 
would be to make both of these checks separate if statements.




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

Предыдущее
От: Amit Kapila
Дата:
Сообщение: pgsql: Fix the handling of the failover option in subscription commands
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Improve "out of range" error messages for GUCs.