git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: 2ab6d28) | patch
Collations with nondeterministic comparison
2019年3月22日 11:09:32 +0000 (12:09 +0100)
2019年3月22日 11:12:43 +0000 (12:12 +0100)
commit 5e1963fb764e9cc092e0f7b58b28985c311431d9
Collations with nondeterministic comparison

This adds a flag "deterministic" to collations. If that is false,
such a collation disables various optimizations that assume that
strings are equal only if they are byte-wise equal. That then allows
use cases such as case-insensitive or accent-insensitive comparisons
or handling of strings with different Unicode normal forms.

This functionality is only supported with the ICU provider. At least
glibc doesn't appear to have any locales that work in a
nondeterministic way, so it's not worth supporting this for the libc
provider.

The term "deterministic comparison" in this context is from Unicode
Technical Standard #10
(https://unicode.org/reports/tr10/#Deterministic_Comparison).

This patch makes changes in three areas:

- CREATE COLLATION DDL changes and system catalog changes to support
this new flag.

- Many executor nodes and auxiliary code are extended to track
collations. Previously, this code would just throw away collation
information, because the eventually-called user-defined functions
didn't use it since they only cared about equality, which didn't
need collation information.

- String data type functions that do equality comparisons and hashing
are changed to take the (non-)deterministic flag into account. For
comparison, this just means skipping various shortcuts and tie
breakers that use byte-wise comparison. For hashing, we first need
to convert the input string to a canonical "sort key" using the ICU
analogue of strxfrm().

Reviewed-by: Daniel Verite <daniel@manitou-mail.org>
Reviewed-by: Peter Geoghegan <pg@bowt.ie>
Discussion: https://www.postgresql.org/message-id/flat/1ccc668f-4cbc-0bef-af67-450b47cdfee7@2ndquadrant.com
69 files changed:
contrib/bloom/bloom.h diff | blob | blame | history
contrib/bloom/blutils.c diff | blob | blame | history
doc/src/sgml/catalogs.sgml diff | blob | blame | history
doc/src/sgml/charset.sgml diff | blob | blame | history
doc/src/sgml/citext.sgml diff | blob | blame | history
doc/src/sgml/func.sgml diff | blob | blame | history
doc/src/sgml/ref/create_collation.sgml diff | blob | blame | history
src/backend/access/hash/hashfunc.c diff | blob | blame | history
src/backend/access/spgist/spgtextproc.c diff | blob | blame | history
src/backend/catalog/pg_collation.c diff | blob | blame | history
src/backend/commands/collationcmds.c diff | blob | blame | history
src/backend/commands/extension.c diff | blob | blame | history
src/backend/executor/execExpr.c diff | blob | blame | history
src/backend/executor/execGrouping.c diff | blob | blame | history
src/backend/executor/execPartition.c diff | blob | blame | history
src/backend/executor/execReplication.c diff | blob | blame | history
src/backend/executor/nodeAgg.c diff | blob | blame | history
src/backend/executor/nodeGroup.c diff | blob | blame | history
src/backend/executor/nodeHash.c diff | blob | blame | history
src/backend/executor/nodeHashjoin.c diff | blob | blame | history
src/backend/executor/nodeRecursiveunion.c diff | blob | blame | history
src/backend/executor/nodeSetOp.c diff | blob | blame | history
src/backend/executor/nodeSubplan.c diff | blob | blame | history
src/backend/executor/nodeUnique.c diff | blob | blame | history
src/backend/executor/nodeWindowAgg.c diff | blob | blame | history
src/backend/nodes/copyfuncs.c diff | blob | blame | history
src/backend/nodes/outfuncs.c diff | blob | blame | history
src/backend/nodes/readfuncs.c diff | blob | blame | history
src/backend/optimizer/plan/createplan.c diff | blob | blame | history
src/backend/optimizer/util/tlist.c diff | blob | blame | history
src/backend/partitioning/partbounds.c diff | blob | blame | history
src/backend/partitioning/partprune.c diff | blob | blame | history
src/backend/regex/regc_pg_locale.c diff | blob | blame | history
src/backend/utils/adt/arrayfuncs.c diff | blob | blame | history
src/backend/utils/adt/like.c diff | blob | blame | history
src/backend/utils/adt/like_support.c diff | blob | blame | history
src/backend/utils/adt/name.c diff | blob | blame | history
src/backend/utils/adt/orderedsetaggs.c diff | blob | blame | history
src/backend/utils/adt/pg_locale.c diff | blob | blame | history
src/backend/utils/adt/ri_triggers.c diff | blob | blame | history
src/backend/utils/adt/varchar.c diff | blob | blame | history
src/backend/utils/adt/varlena.c diff | blob | blame | history
src/backend/utils/cache/catcache.c diff | blob | blame | history
src/backend/utils/cache/lsyscache.c diff | blob | blame | history
src/bin/initdb/initdb.c diff | blob | blame | history
src/bin/pg_dump/pg_dump.c diff | blob | blame | history
src/bin/psql/describe.c diff | blob | blame | history
src/include/catalog/catversion.h diff | blob | blame | history
src/include/catalog/pg_collation.h diff | blob | blame | history
src/include/executor/executor.h diff | blob | blame | history
src/include/executor/hashjoin.h diff | blob | blame | history
src/include/executor/nodeHash.h diff | blob | blame | history
src/include/nodes/execnodes.h diff | blob | blame | history
src/include/nodes/plannodes.h diff | blob | blame | history
src/include/optimizer/planmain.h diff | blob | blame | history
src/include/optimizer/tlist.h diff | blob | blame | history
src/include/partitioning/partbounds.h diff | blob | blame | history
src/include/utils/lsyscache.h diff | blob | blame | history
src/include/utils/pg_locale.h diff | blob | blame | history
src/test/regress/expected/collate.icu.utf8.out diff | blob | blame | history
src/test/regress/expected/collate.linux.utf8.out diff | blob | blame | history
src/test/regress/expected/collate.out diff | blob | blame | history
src/test/regress/expected/subselect.out diff | blob | blame | history
src/test/regress/sql/collate.icu.utf8.sql diff | blob | blame | history
src/test/regress/sql/collate.linux.utf8.sql diff | blob | blame | history
src/test/regress/sql/collate.sql diff | blob | blame | history
src/test/regress/sql/subselect.sql diff | blob | blame | history
src/test/subscription/Makefile diff | blob | blame | history
src/test/subscription/t/012_collation.pl [new file with mode: 0644] blob
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /