Re: Does Type Have = Operator? - Mailing list pgsql-hackers

From Kevin Grittner
Subject Re: Does Type Have = Operator?
Date
Msg-id CACjxUsNes20eBJ10yiU7yoBruvJEArzTacidPXijyA-V-Zt7GA@mail.gmail.com
Whole thread Raw
In response to Re: Does Type Have = Operator?  ("David E. Wheeler" <david@justatheory.com>)
Responses Re: Does Type Have = Operator?  ("David E. Wheeler" <david@justatheory.com>)
List pgsql-hackers
On Wed, May 11, 2016 at 12:23 PM, David E. Wheeler
<david@justatheory.com> wrote:

> Oh, well crap. Maybe I’d be better off just comparing the plain
> text of the expressions as Tom suggested.

At the other extreme are the row comparison operators that only
consider values equal if they have the same storage value.  See the
last paragraph of:

http://www.postgresql.org/docs/9.5/static/functions-comparisons.html#COMPOSITE-TYPE-COMPARISON

| To support matching of rows which include elements without a
| default B-tree operator class, the following operators are
| defined for composite type comparison: *=, *<>, *<, *<=, *>, and
| *>=. These operators compare the internal binary representation
| of the two rows. Two rows might have a different binary
| representation even though comparisons of the two rows with the
| equality operator is true. The ordering of rows under these
| comparison operators is deterministic but not otherwise
| meaningful. These operators are used internally for materialized
| views and might be useful for other specialized purposes such as
| replication but are not intended to be generally useful for
| writing queries.

I'm not clear enough on your intended usage to know whether these
operators are a good fit, but they are sitting there waiting to be
used if they do fit.

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Shawn
Date:
Subject: Re: Need help debugging why autovacuum seems "stuck" -- until I use superuser to vacuum freeze pg_database
Next
From: Robert Haas
Date:
Subject: Re: parallel.c is not marked as test covered