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.
|
Список | 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 по дате отправления: