Re: Choosing default collation/ctype - Mailing list pgsql-general

From Ron Johnson
Subject Re: Choosing default collation/ctype
Date
Msg-id CANzqJaB=zwoYT_rBwUX8q4VyqQBGWyjvAiW=UAJZ0+eh7HU0Zg@mail.gmail.com
Whole thread
In response to Choosing default collation/ctype  (Igor Korot <ikorot01@gmail.com>)
Responses Re: Choosing default collation/ctype
List pgsql-general
On Sun, May 3, 2026 at 3:52 PM Igor Korot <ikorot01@gmail.com> wrote:
Hi, ALL,
In the CREATE DATABASE statement I can use encoding/collation/ctype.

I can retrieve the encoding list with:

[code]
SELECT pg_encoding_to_char( conforencoding ) AS name FROM pg_conversion
[/code]

And then I can get a list of collations/ctypes with:

[code]
SELECT collname, collencoding, collprovider collctype FROM pg_collation
[/code]

And then add a logic in my UI to switch collations/ctypes based on encoding.

However, what I wonder is:

Is there a way to select a default collation/ctype for a specific encoding?

Or maybe I'm overthinking it and I should let the user choose and if
nothing - just keep those 2 as "Default" and let the server pick it
up. However it will be weird, especially from me as a user POV.

You know your data, not us.  The first question I'd try to is "how much client text data is not compatible with bog-standard UTF8?"

--
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!

pgsql-general by date:

Previous
From: Igor Korot
Date:
Subject: Choosing default collation/ctype
Next
From: Igor Korot
Date:
Subject: Re: Choosing default collation/ctype