Re: Multicolumn primary key with null value

From: Adrian von Bidder <avbidder(at)fortytwo(dot)ch>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Multicolumn primary key with null value
Date: 2010-04-23 07:50:43
Message-ID: 201004230952.01994@fortytwo.ch
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian von Bidder 2010-04-23 07:53:55 Re: Creating indexes?
Previous Message Jignesh Shah 2010-04-23 07:30:28 Re: Issue in Improving the performance using prepared plan