diff options
author | Robert Haas <rhaas@postgresql.org> | 2016-02-03 14:17:35 -0500 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2016-02-03 14:29:53 -0500 |
commit | b47b4dbf683f13e6ef09fa0d93aa6e84f3d00819 (patch) | |
tree | 495300ed40d52f5f8f70105a9543697c8d617379 /src/include/utils/builtins.h | |
parent | 24a26c9f5448b24943df4c9bcf154bfd9f8197a6 (diff) | |
download | postgresql-b47b4dbf683f13e6ef09fa0d93aa6e84f3d00819.tar.gz postgresql-b47b4dbf683f13e6ef09fa0d93aa6e84f3d00819.zip |
Extend sortsupport for text to more opclasses.
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.
Diffstat (limited to 'src/include/utils/builtins.h')
-rw-r--r-- | src/include/utils/builtins.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/include/utils/builtins.h b/src/include/utils/builtins.h index c2e529fc6f6..5e8e8329b82 100644 --- a/src/include/utils/builtins.h +++ b/src/include/utils/builtins.h @@ -16,6 +16,7 @@ #include "fmgr.h" #include "nodes/parsenodes.h" +#include "utils/sortsupport.h" /* * Defined in adt/ @@ -761,8 +762,10 @@ extern Datum bpcharle(PG_FUNCTION_ARGS); extern Datum bpchargt(PG_FUNCTION_ARGS); extern Datum bpcharge(PG_FUNCTION_ARGS); extern Datum bpcharcmp(PG_FUNCTION_ARGS); +extern Datum bpchar_sortsupport(PG_FUNCTION_ARGS); extern Datum bpchar_larger(PG_FUNCTION_ARGS); extern Datum bpchar_smaller(PG_FUNCTION_ARGS); +extern int bpchartruelen(char *s, int len); extern Datum bpcharlen(PG_FUNCTION_ARGS); extern Datum bpcharoctetlen(PG_FUNCTION_ARGS); extern Datum hashbpchar(PG_FUNCTION_ARGS); @@ -771,6 +774,7 @@ extern Datum bpchar_pattern_le(PG_FUNCTION_ARGS); extern Datum bpchar_pattern_gt(PG_FUNCTION_ARGS); extern Datum bpchar_pattern_ge(PG_FUNCTION_ARGS); extern Datum btbpchar_pattern_cmp(PG_FUNCTION_ARGS); +extern Datum btbpchar_pattern_sortsupport(PG_FUNCTION_ARGS); extern Datum varcharin(PG_FUNCTION_ARGS); extern Datum varcharout(PG_FUNCTION_ARGS); @@ -808,6 +812,7 @@ extern Datum text_pattern_le(PG_FUNCTION_ARGS); extern Datum text_pattern_gt(PG_FUNCTION_ARGS); extern Datum text_pattern_ge(PG_FUNCTION_ARGS); extern Datum bttext_pattern_cmp(PG_FUNCTION_ARGS); +extern Datum bttext_pattern_sortsupport(PG_FUNCTION_ARGS); extern Datum textlen(PG_FUNCTION_ARGS); extern Datum textoctetlen(PG_FUNCTION_ARGS); extern Datum textpos(PG_FUNCTION_ARGS); @@ -818,6 +823,7 @@ extern Datum textoverlay_no_len(PG_FUNCTION_ARGS); extern Datum name_text(PG_FUNCTION_ARGS); extern Datum text_name(PG_FUNCTION_ARGS); extern int varstr_cmp(char *arg1, int len1, char *arg2, int len2, Oid collid); +extern void varstr_sortsupport(SortSupport ssup, Oid collid, bool bpchar); extern int varstr_levenshtein(const char *source, int slen, const char *target, int tlen, int ins_c, int del_c, int sub_c, |