Add text-vs-name cross-type operators, and unify name_ops with text_ops.
Tom Lane <tgl@sss.pgh.pa.us>
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
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/optimizer/path/indxpath.c | modified | +15 −21 |
| src/backend/utils/adt/selfuncs.c | modified | +1 −3 |
| src/backend/utils/adt/varlena.c | modified | +161 −0 |
| src/include/catalog/catversion.h | modified | +1 −1 |
| src/include/catalog/pg_amop.dat | modified | +50 −19 |
| src/include/catalog/pg_amproc.dat | modified | +12 −8 |
| src/include/catalog/pg_opclass.dat | modified | +2 −2 |
| src/include/catalog/pg_operator.dat | modified | +59 −0 |
| src/include/catalog/pg_opfamily.dat | modified | +0 −4 |
| src/include/catalog/pg_proc.dat | modified | +43 −0 |
| src/test/regress/expected/opr_sanity.out | modified | +14 −0 |
| src/test/regress/expected/regex.out | modified | +7 −7 |
| src/test/regress/expected/select_views.out | modified | +20 −20 |
Discussion
- Collatability of type "name" 5 messages · 2018-12-09 → 2018-12-19