initdb: derive encoding from locale for ICU; similar to libc.
authorJeff Davis <jdavis@postgresql.org>
Fri, 10 Mar 2023 18:51:24 +0000 (10:51 -0800)
committerJeff Davis <jdavis@postgresql.org>
Fri, 10 Mar 2023 18:51:24 +0000 (10:51 -0800)
commitc45dc7ffbba2cb0bf180a0b9edadc22769143e7a
tree770647258cf331fae250613a00da2f85858bc020
parent3e623ebc7a22444ad3d15b36ffa3273c47283e18
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
contrib/unaccent/meson.build
doc/src/sgml/ref/initdb.sgml
src/bin/initdb/initdb.c
src/bin/pg_upgrade/t/002_pg_upgrade.pl
src/bin/scripts/t/020_createdb.pl
src/test/icu/t/010_database.pl