Re: 8.1 Unique Index Issue/Bug??? - Mailing list pgsql-admin

From Rodrigo De Leon
Subject Re: 8.1 Unique Index Issue/Bug???
Date
Msg-id a55915760607130932w47277ce0p397b6af896bfc36c@mail.gmail.com
Whole thread Raw
In response to 8.1 Unique Index Issue/Bug???  ("Chris Hoover" <revoohc@gmail.com>)
Responses Re: 8.1 Unique Index Issue/Bug???  ("Joshua D. Drake" <jd@commandprompt.com>)
List pgsql-admin
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

pgsql-admin by date:

Previous
From: Satya Prakash Tripathi
Date:
Subject: PITR- timeline query
Next
From: "Joshua D. Drake"
Date:
Subject: Re: 8.1 Unique Index Issue/Bug???