Subject: Re: Choosing default collation/ctype

From: Rob Sargent <[email-masked]>
Date: Sun, 3 May 2026 22:16:06 -0600

> On May 3, 2026, at 3:51 PM, Igor Korot <[email-masked]> 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? And you are asking for server side settings to use when you invoke a create database command on the user’s behalf? And they will understand all the possibilities and their consequences?

Or are you asking the user which settings to use for this clientside user? 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.

---

From: Igor Korot <[email-masked]>
Date: Mon, 4 May 2026 13:58:12 -0700

Hi, Rob,

On Sun, May 3, 2026 at 9:16 PM Rob Sargent <[email-masked]> wrote:
> 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.