pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add text-vs-name cross-type operators, and unify name_ops with t
Date: Wed, 19 Dec 2018 22:46:34 +0000
Message-ID: <E1gZkbq-0005XQ-Oh@gemulon.postgresql.org> (raw)

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/2ece7c07dc9a14667c64f107686573590b7e45c3

Modified Files
--------------
src/backend/optimizer/path/indxpath.c      |  36 +++----
src/backend/utils/adt/selfuncs.c           |   4 +-
src/backend/utils/adt/varlena.c            | 161 +++++++++++++++++++++++++++++
src/include/catalog/catversion.h           |   2 +-
src/include/catalog/pg_amop.dat            |  69 +++++++++----
src/include/catalog/pg_amproc.dat          |  20 ++--
src/include/catalog/pg_opclass.dat         |   4 +-
src/include/catalog/pg_operator.dat        |  59 +++++++++++
src/include/catalog/pg_opfamily.dat        |   4 -
src/include/catalog/pg_proc.dat            |  43 ++++++++
src/test/regress/expected/opr_sanity.out   |  14 +++
src/test/regress/expected/regex.out        |  14 +--
src/test/regress/expected/select_views.out |  40 +++----
13 files changed, 385 insertions(+), 85 deletions(-)



Message-ID: <E1gZkbq-0005XQ-Oh@gemulon.postgresql.org>
Permalink:  ../E1gZkbq-0005XQ-Oh@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1gZkbq-0005XQ-Oh@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Add text-vs-name cross-type operators, and unify name_ops with t
  In-Reply-To: <E1gZkbq-0005XQ-Oh@gemulon.postgresql.org>
  References: <E1gZkbq-0005XQ-Oh@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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