Re: Choosing default collation/ctype

From: Igor Korot <ikorot01(at)gmail(dot)com>
To: Rob Sargent <robjsargent(at)gmail(dot)com>
Cc: 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-04 20:58:12
Message-ID: CA+FnnTzPT8v3JKjaYbkY-Q-rq3Vi9zMGnjvjA5v1RjP_myY6BA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi, Rob,

On Sun, May 3, 2026 at 9:16 PM Rob Sargent <robjsargent(at)gmail(dot)com> wrote:
>
>
>
> > On May 3, 2026, at 3:51 PM, Igor Korot <ikorot01(at)gmail(dot)com> wrote:
> >
> > 
> >>
> >>
> >> 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.
> >
> >>
>
> What is your user trying to do? Create a database?

Yes - create a new DB.

> And you are asking for server side settings to use when you invoke a create database command on the user’s behalf?

"CREATE DATABASE" command have an options to set encoding/collation/ctype.
I thought that if they are used - or at least encoding - it defines a
server side encoding and then
the client will perform the conversion based on conversion function or
the type of the client commecting
ODBC/libpq/psql/etc. Or maybe both.

Am I wrong here?

Also it is possible to supply only the encoding, in which case server
should choose some default values
for collation/ctype for the newly created DB.

And if I provide those in my UI instead of saying "Default" and let
the user choose if they are not satisfied
it would be great. Leaving it as "Default" is an option but it is weird.

> And they will understand all the possibilities and their consequences?

"CREATE DATABASE" will be done by DB Admin. From the PG POV no other
user will be able
to do that.
And DB Admin will certainly know what they are doing. If not - they
can consult the help/manual.

>
> Or are you asking the user which settings to use for this clientside user?

No.

> If I were this user I would be pissed off you didn’t make some reasonable guess for a starting point from the current environment.

Thank you.

>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Daniel Gustafsson 2026-05-05 08:49:28 Re: ODBC SSL connection issue on Solaris with PostgreSQL 18 (OpenSSL 1.0.2)
Previous Message Laurenz Albe 2026-05-04 20:45:16 Re: Choosing default collation/ctype