Subject: Re: Setting "ucs_basic" as the default database collation

From: Ron Johnson <[email-masked]>
Date: Sun, 27 Oct 2024 07:56:26 -0400

On Sun, Oct 27, 2024 at 5:32 AM Christophe Pettus <[email-masked]> wrote:

> Is there a way to specify "ucs_basic" (or the other "standard collations"
> [1]) collation as the default database collation at database creation time,
> rather than on a per-column or per-operation basis?
>
> [1]
> https://www.postgresql.org/docs/current/collation.html#COLLATION-MANAGING-STANDARD
>
>
https://www.postgresql.org/docs/16/sql-createdatabase.html

The CREATE DATABASE statement has an ENCODING option.  Does that work with
'ucs_basic'?

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

---

From: Christophe Pettus <[email-masked]>
Date: Sun, 27 Oct 2024 16:55:00 +0200

> On Oct 27, 2024, at 13:56, Ron Johnson <[email-masked]> wrote:
> 
>  The CREATE DATABASE statement has an ENCODING option.  Does that work with 'ucs_basic'?

No:

xof=# create database test encoding=ucs_basic;
ERROR:  ucs_basic is not a valid encoding name
LINE 1: create database test encoding=ucs_basic;
                             ^

Although that's not too surprising; it's a UTF-8 collation, not an encoding as such.  Experimenting with the various other CREATE DATABASE parameters hasn't gotten me any farther.