initdb: derive encoding from locale for ICU; similar to libc.
Jeff Davis <jdavis@postgresql.org>
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
Files
| Path | Change | +/− |
|---|---|---|
| contrib/unaccent/meson.build | modified | +1 −1 |
| doc/src/sgml/ref/initdb.sgml | modified | +13 −7 |
| src/bin/initdb/initdb.c | modified | +8 −7 |
| src/bin/pg_upgrade/t/002_pg_upgrade.pl | modified | +5 −10 |
| src/bin/scripts/t/020_createdb.pl | modified | +1 −1 |
| src/test/icu/t/010_database.pl | modified | +1 −1 |
Documentation touched
Discussion
- pgsql: Use ICU by default at initdb time. 7 messages · 2023-03-09 → 2023-03-10