Mark Mielke <mark@mark.mielke.cc> writes:
> The problem here seems to that "point" should have an equality operator?
For starters ;-). The current implementation of UNION requires it to
have a complete btree opclass. In principle I suppose we could
implement hash-based DISTINCT, which would require only a hash opclass,
but that isn't there either.
Note that the only way that the system knows that an operator has
the semantics of equality is for it to be the equality member of
a btree or hash opclass; there isn't any other representation of
operator semantics in Postgres. So the opclasses not only provide
necessary execution infrastructure, but also the justification
for using a particular operator to define DISTINCT-ness.
regards, tom lane