Re: Multicolumn primary key with null value

Adrian von Bidder <avbidder@fortytwo.ch>

From: Adrian von Bidder <avbidder@fortytwo.ch>
To: pgsql-general@postgresql.org
Date: 2010-04-23T07:50:43Z
Lists: pgsql-general
On Friday 23 April 2010 03.27:29 Craig Ringer wrote:
> insert into test (a,b) values ('fred',NULL);
> insert into test (a,b) values ('fred',NULL);
> 
> 
> ... and will succeed:

Hmm.  Perhaps not as ugly as "none" placeholders:

create unique index on test (b) where a is null;
create unique index on test (a) where b is null;

cheers
-- vbi

-- 
Protect your privacy - encrypt your email: http://fortytwo.ch/gpg/intro