Re: [17] CREATE COLLATION default provider - Mailing list pgsql-hackers

From Gurjeet Singh
Subject Re: [17] CREATE COLLATION default provider
Date
Msg-id CABwTF4WBTHfx7=s+c4HNeEZO0d7Mq7V8Q4qPC2DR-TTrq7JfrA@mail.gmail.com
Whole thread Raw
In response to [17] CREATE COLLATION default provider  (Jeff Davis <pgsql@j-davis.com>)
Responses Re: [17] CREATE COLLATION default provider
List pgsql-hackers
On Wed, Jun 14, 2023 at 9:48 PM Jeff Davis <pgsql@j-davis.com> wrote:
>
> Currently, CREATE COLLATION always defaults the provider to libc.
>
> The attached patch causes it to default to libc if LC_COLLATE/LC_CTYPE
> are specified, otherwise default to the current database default
> collation's provider.

+            if (lccollateEl || lcctypeEl)
+                collprovider = COLLPROVIDER_LIBC;
+            else
+                collprovider = default_locale.provider;

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.

Otherwise the patch looks good.

> v11-0001-CREATE-COLLATION-default-provider.patch

I believe v11 is a typo, and you really meant v1.

Best regards,
Gurjeet
http://Gurje.et



pgsql-hackers by date:

Previous
From: Tommy Pavlicek
Date:
Subject: [PATCH] ltree hash functions
Next
From: "Jonathan S. Katz"
Date:
Subject: PostgreSQL 16 Beta 2 Release Date