Re: Composite Unique Key - Doubt
От | Vibhor Kumar |
---|---|
Тема | Re: Composite Unique Key - Doubt |
Дата | |
Msg-id | 3DC3AFB1-0668-4927-8C52-02C98D17D284@enterprisedb.com обсуждение исходный текст |
Ответ на | Composite Unique Key - Doubt (Technical Doubts <online.technicaldoubts@gmail.com>) |
Ответы |
Re: Composite Unique Key - Doubt
|
Список | pgsql-novice |
On Jun 20, 2013, at 1:56 AM, Technical Doubts <online.technicaldoubts@gmail.com> wrote: > Am using Postgres 9.2 > > I am having a table > > technologies > ( > technologyid bigint, > status character(1), > implementeddate date > *CONSTRAINT technologies_uq UNIQUE (technologyid, status, implementeddate)* > ) > > entering data as > > insert into technologies (technologyid,status,implementeddate) > values > (123,'P',null), > (123,'P',null); > > 2 rows affected. > > table accepting duplicate values in spite of composite unique constraint.. > where I am doing wrong? Reason is null is not equal to null. So, 123,'P',null and 124,'P',null is actually unique composite key. Thanks & Regards, Vibhor Kumar EnterpriseDB Corporation The Postgres Database Company Blog:http://vibhork.blogspot.com
В списке pgsql-novice по дате отправления: