Re: Custom type where not all elements are comparable

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Markus Bertheau <twanger(at)bluetwanger(dot)de>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Custom type where not all elements are comparable
Date: 2004-07-05 16:32:12
Message-ID: 1924.1089045132@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Markus Bertheau <twanger(at)bluetwanger(dot)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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Peter Eisentraut 2004-07-05 19:39:40 Re: Custom type where not all elements are comparable
Previous Message Markus Bertheau 2004-07-05 15:31:36 Custom type where not all elements are comparable