Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t55e6-003yL6-Re for pgsql-general@arkaria.postgresql.org; Sun, 27 Oct 2024 15:57:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1t55e2-00HKIU-Q5 for pgsql-general@arkaria.postgresql.org; Sun, 27 Oct 2024 15:57:35 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t55e2-00HKIL-Eb for pgsql-general@lists.postgresql.org; Sun, 27 Oct 2024 15:57:34 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t55dz-003GuJ-Mx for pgsql-general@postgresql.org; Sun, 27 Oct 2024 15:57:33 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 49RFvSxe3780281; Sun, 27 Oct 2024 11:57:28 -0400 From: Tom Lane To: Christophe Pettus cc: pgsql-general Subject: Re: Setting "ucs_basic" as the default database collation In-reply-to: References: Comments: In-reply-to Christophe Pettus message dated "Sun, 27 Oct 2024 11:31:41 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3780279.1730044648.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sun, 27 Oct 2024 11:57:28 -0400 Message-ID: <3780280.1730044648@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Christophe Pettus writes: > Is there a way to specify "ucs_basic" (or the other "standard collations= " [1]) collation as the default database collation at database creation ti= me, rather than on a per-column or per-operation basis? CREATE DATABASE wants you to specify a locale, which ucs_basic is not. It's defined by SQL as a standard collation name, but that doesn't make it a complete locale specification. You can do something like regression=3D# create database db1 with encoding =3D 'utf8' locale =3D 'en= _US.utf8' template =3D template0; CREATE DATABASE or regression=3D# create database db2 with encoding =3D 'utf8' icu_locale =3D= 'en-US-x-icu' locale_provider =3D icu template =3D template0; CREATE DATABASE or regression=3D# create database db3 with encoding =3D 'utf8' locale =3D 'PO= SIX' template =3D template0; CREATE DATABASE regards, tom lane