Обсуждение: pgsql: Use ICU by default at initdb time.

Поиск
Список
Период
Сортировка

pgsql: Use ICU by default at initdb time.

От
Jeff Davis
Дата:
Use ICU by default at initdb time.

If the ICU locale is not specified, initialize the default collator
and retrieve the locale name from that.

Discussion: https://postgr.es/m/510d284759f6e943ce15096167760b2edcb2e700.camel@j-davis.com
Reviewed-by: Peter Eisentraut

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/27b62377b47f9e7bf58613608bc718c86ea91e91

Modified Files
--------------
contrib/citext/expected/citext_utf8.out            |  9 +++-
contrib/citext/expected/citext_utf8_1.out          |  9 +++-
contrib/citext/sql/citext_utf8.sql                 |  9 +++-
contrib/unaccent/expected/unaccent.out             |  9 ++++
contrib/unaccent/expected/unaccent_1.out           |  8 ++++
contrib/unaccent/sql/unaccent.sql                  | 11 +++++
doc/src/sgml/ref/initdb.sgml                       | 53 +++++++++++++--------
src/bin/initdb/Makefile                            |  4 +-
src/bin/initdb/initdb.c                            | 54 +++++++++++++++++++++-
src/bin/initdb/t/001_initdb.pl                     |  7 +--
src/bin/pg_dump/t/002_pg_dump.pl                   |  2 +-
src/bin/scripts/t/020_createdb.pl                  |  2 +-
src/interfaces/ecpg/test/Makefile                  |  3 --
src/interfaces/ecpg/test/connect/test5.pgc         |  2 +-
src/interfaces/ecpg/test/expected/connect-test5.c  |  2 +-
.../ecpg/test/expected/connect-test5.stderr        |  2 +-
src/interfaces/ecpg/test/meson.build               |  1 -
src/test/icu/t/010_database.pl                     |  2 +-
18 files changed, 147 insertions(+), 42 deletions(-)


Re: pgsql: Use ICU by default at initdb time.

От
Jeff Davis
Дата:
On Thu, 2023-03-09 at 19:11 +0000, Jeff Davis wrote:
> Use ICU by default at initdb time.

I'm seeing a failure on hoverfly:


https://buildfarm.postgresql.org/cgi-bin/show_stage_log.pl?nm=hoverfly&dt=2023-03-09%2021%3A51%3A45&stg=initdb-en_US.8859-15

That's because ICU always uses UTF-8 by default. ICU works just fine
with many other encodings; is there a reason it doesn't take it from
the environment just like for provider=libc?

Of course, we still need to default to UTF-8 when the encoding from the
environment isn't supported by ICU.

Patch attached. Requires a few test fixups to adapt.

--
Jeff Davis
PostgreSQL Contributor Team - AWS



Вложения