aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/selfuncs.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2018-12-19 17:46:07 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2018-12-19 17:46:25 -0500
commit2ece7c07dc9a14667c64f107686573590b7e45c3 (patch)
tree8b25e2d875d21defd1cbe3dcc3be9c22134fd002 /src/backend/utils/adt/selfuncs.c
parent586b98fdf1aaef4a27744f8b988479aad4bd9a01 (diff)
downloadpostgresql-2ece7c07dc9a14667c64f107686573590b7e45c3.tar.gz
postgresql-2ece7c07dc9a14667c64f107686573590b7e45c3.zip
Add text-vs-name cross-type operators, and unify name_ops with text_ops.
Now that name comparison has effectively the same behavior as text comparison, we might as well merge the name_ops opfamily into text_ops, allowing cross-type comparisons to be processed without forcing a datatype coercion first. We need do little more than add cross-type operators to make the opfamily complete, and fix one or two places in the planner that assumed text_ops was a single-datatype opfamily. I chose to unify hash name_ops into hash text_ops as well, since the types have compatible hashing semantics. This allows marking the new cross-type equality operators as oprcanhash. (Note: this doesn't remove the name_ops opclasses, so there's no breakage of index definitions. Those opclasses are just reparented into the text_ops opfamily.) Discussion: https://postgr.es/m/15938.1544377821@sss.pgh.pa.us
Diffstat (limited to 'src/backend/utils/adt/selfuncs.c')
-rw-r--r--src/backend/utils/adt/selfuncs.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c
index ebedb269832..7155dc90875 100644
--- a/src/backend/utils/adt/selfuncs.c
+++ b/src/backend/utils/adt/selfuncs.c
@@ -1292,14 +1292,12 @@ patternsel(PG_FUNCTION_ARGS, Pattern_Type ptype, bool negate)
switch (vartype)
{
case TEXTOID:
+ case NAMEOID:
opfamily = TEXT_BTREE_FAM_OID;
break;
case BPCHAROID:
opfamily = BPCHAR_BTREE_FAM_OID;
break;
- case NAMEOID:
- opfamily = NAME_BTREE_FAM_OID;
- break;
case BYTEAOID:
opfamily = BYTEA_BTREE_FAM_OID;
break;