X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 0A480DB6CA for ; Tue, 1 Nov 2005 13:05:50 -0400 (AST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 12962-07 for ; Tue, 1 Nov 2005 17:05:46 +0000 (GMT) Received: from mail.unimedijui.com.br (mail.unimedijui.com.br [200.102.201.73]) by svr1.postgresql.org (Postfix) with ESMTP id A1086DB6C2 for ; Tue, 1 Nov 2005 13:05:44 -0400 (AST) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.unimedijui.com.br (Postfix) with ESMTP id B493DE83F8 for ; Tue, 1 Nov 2005 14:17:43 -0200 (BRST) Received: from mail.unimedijui.com.br ([127.0.0.1]) by localhost (safe [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 14362-02 for ; Tue, 1 Nov 2005 14:17:41 -0200 (BRST) Received: from [192.168.2.138] (unknown [192.168.2.138]) by mail.unimedijui.com.br (Postfix) with ESMTP id 492B6E83EB for ; Tue, 1 Nov 2005 14:17:41 -0200 (BRST) Message-ID: <4367AF54.6010909@unimedijui.com.br> Date: Tue, 01 Nov 2005 15:09:24 -0300 From: Diego User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: pt-br, pt MIME-Version: 1.0 To: pgsql-admin@postgresql.org Subject: UNIQUE KEY with null value... Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at unimedijui.com.br X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[none] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200511/2 X-Sequence-Number: 19375 Hi, Iīm a brazilian programmer! I have a question about Postgres UNIQUE KEY. Look: (Step 1) CREATE TABLE test ( id integer not null primary key, id_uni integer not null, cod integer, name varchar(40), constraint test_uk unique(id_uni, cod) ) (Step 2) insert into test (id, id_uni, cod, name) values (1, 1, null, 'A') (Step 3) insert into test (id, id_uni, cod, name) values (2, 1, null, 'B') =========> [Have the same UNIQUE KEY] Why postgresql donīt break insertion in this case???? Thanks Diego Ziquinatti Brazil