| From: | Igor Korot <ikorot01(at)gmail(dot)com> |
|---|---|
| To: | Ron Johnson <ronljohnsonjr(at)gmail(dot)com>, "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org> |
| Subject: | Re: Choosing default collation/ctype |
| Date: | 2026-05-03 21:51:32 |
| Message-ID: | CA+FnnTz0bXuTUR5CqXNM5xR3UM9MbTOkYdUP5rUNGSQxZaznXg@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
Hi, Ron.
On Sun, May 3, 2026 at 4:05 PM Ron Johnson <ronljohnsonjr(at)gmail(dot)com> wrote:
>
> On Sun, May 3, 2026 at 4:52 PM Igor Korot <ikorot01(at)gmail(dot)com> wrote:
>>
>> Hi,
>>
>> On Sun, May 3, 2026 at 3:09 PM Ron Johnson <ronljohnsonjr(at)gmail(dot)com> wrote:
>> >
>> > On Sun, May 3, 2026 at 3:52 PM Igor Korot <ikorot01(at)gmail(dot)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?"
>>
>> I don't.
>> Just trying to create a generic tool to use for people everywhere...
>
>
> Then choose UTF8.
Let me give you a quick run of what I'm trying to do:
In my code I have 3 combo boxes: encoding, collation and ctype.
Initially they all have a value of "Default".
Lets say a user selected "KOI8-R" as an emcoding.
What I will do is populate collation and ctype combo boxes with
values available for such encodings.
But I want to go a little further and change the values in those
to be the default collation/ctype for the "KOI8-R" encoding.
Now are you saying I should choose the one that have "UTF8"
in it?
Thank you.
>
> --
> Death to <Redacted>, and butter sauce.
> Don't boil me, I'm still alive.
> <Redacted> lobster!
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Rob Sargent | 2026-05-04 04:16:06 | Re: Choosing default collation/ctype |
| Previous Message | Laurenz Albe | 2026-05-03 21:17:04 | Re: Choosing default collation/ctype |