RE: unique constraint - bug?

From: "Mikheev, Vadim" <vmikheev(at)SECTORBASE(dot)COM>
To: "'Merrill Oveson'" <merrill(at)actarg(dot)com>, pgsql-general(at)postgresql(dot)org
Cc: Kyle Bateman <kyle(at)actiontarget(dot)com>
Subject: RE: unique constraint - bug?
Date: 2000-07-20 00:22:36
Message-ID: 8F4C99C66D04D4118F580090272A7A23018C66@SECTORBASE1
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> unique (a, b, c)
> );
>
> insert into letter values('1','2','3');
> insert into letter values('1','2','3');
>
> insert into letter (a,c) values ('1','3');
> insert into letter (a,c) values ('1','3');
>
> Notice that the second insert of ('1','2','3') yields an
> error message, which is the correct behavior - (that is the unique
> constaint is working), while the last insert of ('1','3') does not yield
> an error message - (that is the unique constraint doesn't work in this
> case - I think it should).

NULL != NULL - ie you can't say that both keys are equal.
(That's why PK constraint disallow NULLs...)

Vadim

Browse pgsql-general by date

  From Date Subject
Next Message Chris Bitmead 2000-07-20 00:31:37 Re: Re: [GENERAL] PRIMARY KEY & INHERITANCE (fwd)
Previous Message Stephan Szabo 2000-07-20 00:18:17 Re: Re: [GENERAL] PRIMARY KEY & INHERITANCE (fwd)