Search Postgresql Archives

Re: Implementing DB2's "distinct" types

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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





--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux