Re: Implementing DB2's "distinct" types

From: Thomas Kellerer <spam_eater(at)gmx(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Implementing DB2's "distinct" types
Date: 2013-04-22 07:09:16
Message-ID: kl2nki$ggj$1@ger.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>> create type sno as varchar(50)
>> with comparisons;
>>
>> create type pno as varchar(50)
>> with comparisons;
>>
>> The following query will be rejected because sno and pno are not comparable (even though both are varchar columns):
>>
>> select *
>> from p
>> join s on s.sno = p.pno;
>>
>> I wonder if a similar behaviour can be achieved with Postgres' types as well.
>>
>> As a type definition in Postgres can also include comparison functions, I have the feeling that
>>this should be possible, but I don't have an idea on how to start to be honest.
>>
>
> Please mark this to pgsql-hackers, where you might get much better constructive feedback.
>
> It does sound nice.

I'm more interested if this can be dealt with on SQL level, rather than hacking Postgres itself
(and it's not really a "request" for a new feature - I'm just curious)

Thomas

Sent from my Thunderbird

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Darren Duncan 2013-04-22 09:01:24 Re: Implementing DB2's "distinct" types
Previous Message Abhinav Dwivedi 2013-04-22 05:12:19 bug in 8.4 and resolved