]> granicus.if.org Git - postgresql/commit
ICU support
authorPeter Eisentraut <peter_e@gmx.net>
Thu, 23 Mar 2017 19:25:34 +0000 (15:25 -0400)
committerPeter Eisentraut <peter_e@gmx.net>
Thu, 23 Mar 2017 19:28:48 +0000 (15:28 -0400)
commiteccfef81e1f73ee41f1d8bfe4fa4e80576945048
tree52bd1b2468bcf9682b356cf5b5f6199ae9d80ee4
parentea42cc18c35381f639d45628d792e790ff39e271
ICU support

Add a column collprovider to pg_collation that determines which library
provides the collation data.  The existing choices are default and libc,
and this adds an icu choice, which uses the ICU4C library.

The pg_locale_t type is changed to a union that contains the
provider-specific locale handles.  Users of locale information are
changed to look into that struct for the appropriate handle to use.

Also add a collversion column that records the version of the collation
when it is created, and check at run time whether it is still the same.
This detects potentially incompatible library upgrades that can corrupt
indexes and other structures.  This is currently only supported by
ICU-provided collations.

initdb initializes the default collation set as before from the `locale
-a` output but also adds all available ICU locales with a "-x-icu"
appended.

Currently, ICU-provided collations can only be explicitly named
collations.  The global database locales are still always libc-provided.

ICU support is enabled by configure --with-icu.

Reviewed-by: Thomas Munro <thomas.munro@enterprisedb.com>
Reviewed-by: Andreas Karlsson <andreas@proxel.se>
45 files changed:
aclocal.m4
config/pkg.m4 [new file with mode: 0644]
configure
configure.in
doc/src/sgml/catalogs.sgml
doc/src/sgml/charset.sgml
doc/src/sgml/func.sgml
doc/src/sgml/installation.sgml
doc/src/sgml/mvcc.sgml
doc/src/sgml/ref/alter_collation.sgml
doc/src/sgml/ref/create_collation.sgml
src/Makefile.global.in
src/backend/Makefile
src/backend/catalog/pg_collation.c
src/backend/commands/collationcmds.c
src/backend/common.mk
src/backend/nodes/copyfuncs.c
src/backend/nodes/equalfuncs.c
src/backend/parser/gram.y
src/backend/regex/regc_pg_locale.c
src/backend/tcop/utility.c
src/backend/utils/adt/formatting.c
src/backend/utils/adt/like.c
src/backend/utils/adt/pg_locale.c
src/backend/utils/adt/selfuncs.c
src/backend/utils/adt/varlena.c
src/backend/utils/mb/encnames.c
src/bin/initdb/initdb.c
src/bin/pg_dump/pg_dump.c
src/bin/pg_dump/t/002_pg_dump.pl
src/bin/psql/describe.c
src/include/catalog/pg_collation.h
src/include/catalog/pg_collation_fn.h
src/include/catalog/pg_proc.h
src/include/commands/collationcmds.h
src/include/mb/pg_wchar.h
src/include/nodes/nodes.h
src/include/nodes/parsenodes.h
src/include/pg_config.h.in
src/include/utils/pg_locale.h
src/test/regress/GNUmakefile
src/test/regress/expected/collate.icu.out [new file with mode: 0644]
src/test/regress/expected/collate.linux.utf8.out
src/test/regress/sql/collate.icu.sql [new file with mode: 0644]
src/test/regress/sql/collate.linux.utf8.sql