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