Re: Custom type where not all elements are comparable - Mailing list pgsql-sql

From Tom Lane
Subject Re: Custom type where not all elements are comparable
Date
Msg-id 1924.1089045132@sss.pgh.pa.us
Whole thread Raw
In response to Custom type where not all elements are comparable  (Markus Bertheau <twanger@bluetwanger.de>)
List pgsql-sql
Markus Bertheau <twanger@bluetwanger.de> writes:
> Is it possible to define or implement a type in PostgreSQL not all
> values of which are comparable to each other?

Certainly, as long as you don't expect to be able to btree-index it,
sort it, or DISTINCT it.  (In theory we could probably handle DISTINCT
using hash aggregation, as long as equality behaves sanely; but that's
not implemented now.)

Probably it'd be reasonable for the comparison operators to return
NULL for a noncomparable pair of inputs.
        regards, tom lane


pgsql-sql by date:

Previous
From: Markus Bertheau
Date:
Subject: Custom type where not all elements are comparable
Next
From: Peter Eisentraut
Date:
Subject: Re: Custom type where not all elements are comparable