X-Original-To: pgsql-admin-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 2F5199FA192 for ; Fri, 30 Jun 2006 16:57:03 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 99270-10 for ; Fri, 30 Jun 2006 16:56:55 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from wolff.to (wolff.to [66.93.197.194]) by postgresql.org (Postfix) with SMTP id D59D59FA0EC for ; Fri, 30 Jun 2006 16:56:53 -0300 (ADT) Received: (qmail 28841 invoked by uid 500); 30 Jun 2006 20:00:57 -0000 Date: Fri, 30 Jun 2006 15:00:57 -0500 From: Bruno Wolff III To: Alex Soto Cc: pgsql-admin@postgresql.org Subject: Re: Constraint Null Value Message-ID: <20060630200057.GA25021@wolff.to> Mail-Followup-To: Bruno Wolff III , Alex Soto , pgsql-admin@postgresql.org References: <44A53835.5000202@grifols.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <44A53835.5000202@grifols.com> User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/284 X-Sequence-Number: 22246 On Fri, Jun 30, 2006 at 16:41:57 +0200, Alex Soto wrote: > I am is Alex, and I m developing a product with PostgreSQL 8.1. I have a > problem. This problem is that i have some unique constraints with > multi-columns. The problem is that there is some that of the check > constraint condition that can be null. As it is described in section > 5.3.3, null of one row is different from the null of other row, so we > can have two entries with same values inserted because of null value is > not a considered equal in this comparison. > > Is there any administration syntax to change this behavior so null > values are treated as same value? No, but you can use partial indexes to impose that constraint. This came up a couple of months ago on one of the lists and there was a bit more discussion on the specifics if "use partial indexes" isn't enough of a hint for you.