pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rodrigo De Leon <rdeleonp@gmail.com>
To: pgsql-admin@postgresql.org
Subject: Re: 8.1 Unique Index Issue/Bug???
Date: Thu, 13 Jul 2006 11:32:10 -0500
Message-ID: <a55915760607130932w47277ce0p397b6af896bfc36c@mail.gmail.com> (raw)
In-Reply-To: <1d219a6f0607130740g7fe13967t48c77a64fde977aa@mail.gmail.com>
References: <1d219a6f0607130740g7fe13967t48c77a64fde977aa@mail.gmail.com>

On 7/13/06, Chris Hoover <revoohc@gmail.com> wrote:
> On this table, I have created a unique index on payer_trn03, payer_trn04,
> and expire_timestamp.  However, since the expire_timestamp is normally null,
> the unique index does not appear to be working.  I have been able to enter
> two identical rows into this table.
>
> Why is PostgreSQL not enforcing this index? This appears to be a pretty
> major a bug?  It would seem that you could have a unique index across
> columns that might have a null in them.

From:

http://www.postgresql.org/docs/8.1/interactive/indexes-unique.html

Quote:

"When an index is declared unique, multiple table rows with equal
indexed values will not be allowed. Null values are not considered
equal. A multicolumn unique index will only reject cases where all of
the indexed columns are equal in two rows."

Regards,

Rodrigo



view thread (10+ messages)  latest in thread

Message-ID: <a55915760607130932w47277ce0p397b6af896bfc36c@mail.gmail.com>
Permalink:  ../a55915760607130932w47277ce0p397b6af896bfc36c@mail.gmail.com/
Also on:    postgresql.org/message-id/a55915760607130932w47277ce0p397b6af896bfc36c@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: rdeleonp@gmail.com
  Subject: Re: 8.1 Unique Index Issue/Bug???
  In-Reply-To: <a55915760607130932w47277ce0p397b6af896bfc36c@mail.gmail.com>
  References: <1d219a6f0607130740g7fe13967t48c77a64fde977aa@mail.gmail.com> <a55915760607130932w47277ce0p397b6af896bfc36c@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox