pgsql: initdb: derive encoding from locale for ICU; similar to libc.

From: Jeff Davis <jdavis(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: initdb: derive encoding from locale for ICU; similar to libc.
Date: 2023-03-10 18:52:16
Message-ID: E1pahqh-002t5V-Ik@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

initdb: derive encoding from locale for ICU; similar to libc.

Previously, the default encoding was derived from the locale when
using libc; while the default was always UTF-8 when using ICU. That
would throw an error when the locale was not compatible with UTF-8.

This commit causes initdb to derive the default encoding from the
locale for both providers. If --no-locale is specified (or if the
locale is C or POSIX), the default encoding will be UTF-8 for ICU
(because ICU does not support SQL_ASCII) and SQL_ASCII for libc.

Per buildfarm failure on system "hoverfly" related to commit
27b62377b4.

Discussion: https://postgr.es/m/d191d5841347301a8f1238f609471ddd957fc47e.camel%40j-davis.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/c45dc7ffbba2cb0bf180a0b9edadc22769143e7a

Modified Files
--------------
contrib/unaccent/meson.build | 2 +-
doc/src/sgml/ref/initdb.sgml | 20 +++++++++++++-------
src/bin/initdb/initdb.c | 15 ++++++++-------
src/bin/pg_upgrade/t/002_pg_upgrade.pl | 15 +++++----------
src/bin/scripts/t/020_createdb.pl | 2 +-
src/test/icu/t/010_database.pl | 2 +-
6 files changed, 29 insertions(+), 27 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2023-03-10 18:52:57 pgsql: Ensure COPY TO on an RLS-enabled table copies no more than it sh
Previous Message Jeff Davis 2023-03-10 15:48:13 Re: pgsql: Use ICU by default at initdb time.