Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T4aX3-0003HI-RI for pgsql-bugs@postgresql.org; Thu, 23 Aug 2012 16:45:21 +0000 Received: from mail-pb0-f46.google.com ([209.85.160.46]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T4aX0-0001HR-Gc for pgsql-bugs@postgresql.org; Thu, 23 Aug 2012 16:45:20 +0000 Received: by pbbrr13 with SMTP id rr13so1794890pbb.19 for ; Thu, 23 Aug 2012 09:45:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:subject:from:to:cc:date:in-reply-to:references :content-type:x-mailer:content-transfer-encoding:mime-version :x-gm-message-state; bh=rlLlKk7MKwYQbT39+WBUJGwWnG262I/exDzFN3hRzgE=; b=GhL8L+L8he0UY/LZDnbinHKXdMxX7+LOnYEA3F6Y+r+Fu6+ln3vEECVX9Y2+vnn8kj goa0B/8Dmmd6GEFmoP185+odNNB3eHMQxe7QIwAn0qhFQbVihX99W7HfwZ4F7YxlAhrd VRgltmZ2DwJFuOvRtxgZxtR4xm9CgXWBNwZD1tiD+Qd1CNrbBzKrnxgNl7rbN0+U0kUs /vM4A170F1WKX+CZKmvPQ0Mxrt0vNOcSYEP7xSpLMT2i2U47aLWG7rH9s9Hij2X1Goad j6hq7vB8j6brepSiYGTyJRANv8Jbd9V0hjBmhnsYHzLbpdfcghv1oxchcZL/tpeDETto kyJw== Received: by 10.68.194.169 with SMTP id hx9mr6177669pbc.8.1345740316918; Thu, 23 Aug 2012 09:45:16 -0700 (PDT) Received: from [192.168.1.101] (c-69-181-249-16.hsd1.ca.comcast.net. [69.181.249.16]) by mx.google.com with ESMTPS id y11sm6316945pbv.66.2012.08.23.09.45.15 (version=SSLv3 cipher=OTHER); Thu, 23 Aug 2012 09:45:16 -0700 (PDT) Message-ID: <1345740325.16150.3.camel@jdavis> Subject: Re: BUG #7501: Unique index fails to check uniqueness on nulls From: Jeff Davis To: matthew.p.kusnierz@jpmorgan.com Cc: pgsql-bugs@postgresql.org Date: Thu, 23 Aug 2012 09:45:25 -0700 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.2- Content-Transfer-Encoding: 7bit Mime-Version: 1.0 X-Gm-Message-State: ALoCoQmBtaYSmDl1mV+px0iHNupdkvizNkZa2V5fx86rrTLIINGKl0Co7pSMnMZ8jVOXeJOGSgQt X-Pg-Spam-Score: -2.6 (--) X-Archive-Number: 201208/178 X-Sequence-Number: 33902 On Thu, 2012-08-23 at 09:38 +0000, matthew.p.kusnierz@jpmorgan.com wrote: > Multi-column unique indexes allow duplicate rows to be inserted if any of > the indexed columns are inserted with a null. That is mandated in the SQL spec, and is documented here: "For the purpose of a unique constraint, null values are not considered equal." -- http://www.postgresql.org/docs/9.2/static/sql-createtable.html NULLs can be confusing, I know. Regards, Jeff Davis