X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 1D69CD1B1BC for ; Mon, 5 Jul 2004 13:32:20 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 04283-10 for ; Mon, 5 Jul 2004 16:32:15 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id C7FDBD1B1B4 for ; Mon, 5 Jul 2004 13:32:14 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.11/8.12.11) with ESMTP id i65GWCDw001925; Mon, 5 Jul 2004 12:32:12 -0400 (EDT) To: Markus Bertheau Cc: pgsql-sql@postgresql.org Subject: Re: Custom type where not all elements are comparable In-reply-to: <1089041496.3239.13.camel@dicaprio.akademie1.de> References: <1089041496.3239.13.camel@dicaprio.akademie1.de> Comments: In-reply-to Markus Bertheau message dated "Mon, 05 Jul 2004 17:31:36 +0200" Date: Mon, 05 Jul 2004 12:32:12 -0400 Message-ID: <1924.1089045132@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200407/23 X-Sequence-Number: 18275 Markus Bertheau 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