Re: [17] CREATE COLLATION default provider

Поиск
Список
Период
Сортировка
От Jeff Davis
Тема Re: [17] CREATE COLLATION default provider
Дата
Msg-id 847808fd892c91835f880194f97eefcd62bbe36e.camel@j-davis.com
обсуждение исходный текст
Ответ на Re: [17] CREATE COLLATION default provider  (Gurjeet Singh <gurjeet@singh.im>)
Ответы Re: [17] CREATE COLLATION default provider  (Gurjeet Singh <gurjeet@singh.im>)
Список pgsql-hackers
On Sat, 2023-06-17 at 09:09 -0700, Gurjeet Singh wrote:
> The docs for the CREATE COLLATION option 'locale' say: "This is a
> shortcut for setting LC_COLLATE and LC_CTYPE at once."
>
> So it's not intuitive why the check does not include a test for the
> presence of 'localeEl', as well? If we consider the presence of
> LC_COLLATE _or_ LC_CTYPE options to be a determining factor for some
> decision, then the presence of LOCALE option should also lead to the
> same outcome.
>

The docs say: "If provider is libc, this is a shortcut...". The point
is that LC_COLLATE and LC_CTYPE act as a signal that what the user
really wants is a libc collation. LOCALE works for either, so we need a
default.

That being said, I'm now having second thoughts about where that
default should come from. While getting the default from datlocprovider
is convenient, I'm not sure that the datlocprovider provides a good
signal. A lot of users will have datlocprovider=c and datcollate=C,
which really means they want the built-in memcmp behavior, and to me
that doesn't signal that they want CREATE COLLATION to use libc for a
non-C locale.

A GUC might be a better default, and we could have CREATE COLLATION
default to ICU if the server is built with ICU and if PROVIDER,
LC_COLLATE and LC_CTYPE are unspecified.

Regards,
    Jeff Davis




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

Предыдущее
От: Jeff Davis
Дата:
Сообщение: Re: pgsql: Fix search_path to a safe value during maintenance operations.
Следующее
От: Matthias van de Meent
Дата:
Сообщение: Re: HOT readme missing documentation on summarizing index handling