Extend sortsupport for text to more opclasses

Enterprise / PostgreSQL - Robert Haas [postgresql.org] - 3 February 2016 13:29 UTC

Have varlena.c expose an interface that allows the char(n), bytea, and bpchar types to piggyback on a now-generalized SortSupport for text. This pushes a little more knowledge of the bpchar/char(n) type into
varlena.c than might be preferred, but that seems like the approach that creates least friction. Also speed things up for index builds that use text_pattern_ops or varchar_pattern_ops.

This patch does quite a bit of renaming, but it seems likely to be worth it, so as to avoid future confusion about the fact that this code is now more generally used than the old names might have suggested.

Peter Geoghegan, reviewed by Álvaro Herrera and Andreas Karlsson, with small tweaks by me.

b47b4db Extend sortsupport for text to more opclasses.
doc/src/sgml/datatype.sgml | 3 +-
src/backend/utils/adt/varchar.c | 55 +++++-
src/backend/utils/adt/varlena.c | 391 ++++++++++++++++++++++++++------------
src/include/catalog/catversion.h | 2 +-
src/include/catalog/pg_amproc.h | 4 +
src/include/catalog/pg_proc.h | 8 +
src/include/utils/builtins.h | 6 +
src/include/utils/bytea.h | 1 +
8 files changed, 335 insertions(+), 135 deletions(-)

Upstream: git.postgresql.org


  • Share