Re: [GENERAL] Unique index with Null value in one field

2005-10-20 Thread Chris Travers
Hrishi Joshi wrote: Hi, I need to define a Unique index on 3 non-PK fields (composite key) on my table in PostgreSQL 8.0.3. The problem is, if any of those 3 fields is Null, PostgreSQL allows duplicate rows to be inserted. While searching through archives, I found more information about this.

Re: [GENERAL] Unique index with Null value in one field

2005-10-12 Thread Jaime Casanova
On 11 Oct 2005 17:36:59 -0500, Hrishi Joshi <[EMAIL PROTECTED]> wrote: > Hi, > > I need to define a Unique index on 3 non-PK fields (composite key) on my > table in PostgreSQL 8.0.3. > > The problem is, if any of those 3 fields is Null, PostgreSQL allows > duplicate rows to be inserted. While searc

Re: [GENERAL] Unique index with Null value in one field

2005-10-11 Thread Stephan Szabo
On Tue, 11 Oct 2005, Hrishi Joshi wrote: > I need to define a Unique index on 3 non-PK fields (composite key) on my > table in PostgreSQL 8.0.3. > > The problem is, if any of those 3 fields is Null, PostgreSQL allows > duplicate rows to be inserted. While searching through archives, I found > mor

Re: [GENERAL] Unique index with Null value in one field

2005-10-11 Thread Tom Lane
Hrishi Joshi <[EMAIL PROTECTED]> writes: > I need to define a Unique index on 3 non-PK fields (composite key) on my > table in PostgreSQL 8.0.3. > The problem is, if any of those 3 fields is Null, PostgreSQL allows > duplicate rows to be inserted. That is the behavior defined by the SQL standard.

[GENERAL] Unique index with Null value in one field

2005-10-11 Thread Hrishi Joshi
Hi, I need to define a Unique index on 3 non-PK fields (composite key) on my table in PostgreSQL 8.0.3. The problem is, if any of those 3 fields is Null, PostgreSQL allows duplicate rows to be inserted. While searching through archives, I found more information about this. But I need to know how