pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Fix up handling of nondeterministic collations with pattern_ops 2+ messages / 1 participants [nested] [flat]
* pgsql: Fix up handling of nondeterministic collations with pattern_ops @ 2019-09-21 20:29 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 2+ messages in thread From: Tom Lane @ 2019-09-21 20:29 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix up handling of nondeterministic collations with pattern_ops opclasses. text_pattern_ops and its siblings can't be used with nondeterministic collations, because they use the text_eq operator which will not behave as bitwise equality if applied with a nondeterministic collation. The initial implementation of that restriction was to insert a run-time test in the related comparison functions, but that is inefficient, may throw misleading errors, and will throw errors in some cases that would work. It seems sufficient to just prevent the combination during CREATE INDEX, so do that instead. Lacking any better way to identify the opclasses involved, we need to hard-wire tests for them, which requires hand-assigned values for their OIDs, which forces a catversion bump because they previously had OIDs that would be assigned automatically. That's slightly annoying in the v12 branch, but fortunately we're not at rc1 yet, so just do it. Back-patch to v12 where nondeterministic collations were added. In passing, run make reformat-dat-files, which found some unrelated whitespace issues (slightly different ones in HEAD and v12). Peter Eisentraut, with small corrections by me Discussion: https://postgr.es/m/22566.1568675619@sss.pgh.pa.us Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/2810396312664bdb941e549df7dfa75218d73a1c Modified Files -------------- src/backend/catalog/index.c | 45 +++++++++++++++++++++++++++++++++++++ src/backend/utils/adt/varchar.c | 32 +++++--------------------- src/backend/utils/adt/varlena.c | 43 +++++------------------------------ src/include/catalog/catversion.h | 2 +- src/include/catalog/pg_opclass.dat | 9 +++++--- src/include/catalog/pg_operator.dat | 4 ++-- 6 files changed, 66 insertions(+), 69 deletions(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
* pgsql: Fix up handling of nondeterministic collations with pattern_ops @ 2019-09-21 20:29 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 2+ messages in thread From: Tom Lane @ 2019-09-21 20:29 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix up handling of nondeterministic collations with pattern_ops opclasses. text_pattern_ops and its siblings can't be used with nondeterministic collations, because they use the text_eq operator which will not behave as bitwise equality if applied with a nondeterministic collation. The initial implementation of that restriction was to insert a run-time test in the related comparison functions, but that is inefficient, may throw misleading errors, and will throw errors in some cases that would work. It seems sufficient to just prevent the combination during CREATE INDEX, so do that instead. Lacking any better way to identify the opclasses involved, we need to hard-wire tests for them, which requires hand-assigned values for their OIDs, which forces a catversion bump because they previously had OIDs that would be assigned automatically. That's slightly annoying in the v12 branch, but fortunately we're not at rc1 yet, so just do it. Back-patch to v12 where nondeterministic collations were added. In passing, run make reformat-dat-files, which found some unrelated whitespace issues (slightly different ones in HEAD and v12). Peter Eisentraut, with small corrections by me Discussion: https://postgr.es/m/22566.1568675619@sss.pgh.pa.us Branch ------ REL_12_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/d3c61e88d94cba2070574dccbfba06bbc738c876 Modified Files -------------- src/backend/catalog/index.c | 45 ++++++++++++++++++++++++++++++++++++++ src/backend/utils/adt/varchar.c | 32 +++++---------------------- src/backend/utils/adt/varlena.c | 43 +++++------------------------------- src/include/catalog/catversion.h | 2 +- src/include/catalog/pg_opclass.dat | 9 +++++--- src/include/catalog/pg_proc.dat | 3 +-- 6 files changed, 65 insertions(+), 69 deletions(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2019-09-21 20:29 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2019-09-21 20:29 pgsql: Fix up handling of nondeterministic collations with pattern_ops Tom Lane <tgl@sss.pgh.pa.us> 2019-09-21 20:29 pgsql: Fix up handling of nondeterministic collations with pattern_ops Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox