Re: [GENERAL] Weird unique constraint

2010-05-12 Thread Igor Neyman
> -Original Message- > From: Mike Christensen [mailto:m...@kitchenpc.com] > Sent: Wednesday, May 12, 2010 3:10 AM > To: Thom Brown > Cc: pgsql-general@postgresql.org > Subject: Re: Weird unique constraint > > By golly you're right; maybe I should try this stuff before I > email hundre

Re: [GENERAL] Weird unique constraint

2010-05-12 Thread Grzegorz Jaƛkiewicz
If you think about it, NULL is not a value. It makes sens that it allows multiple NULLs. If you don't agree, than your SQL point of view doesn't match the majority, and your designs won't fit in the SQL paradigm . I think it is just a matter of experimenting, and experience to see how useful it is

Re: [GENERAL] Weird unique constraint

2010-05-12 Thread Rob Richardson
Not to mention teaching some of us something we didn't know. RobR, who probably should know a lot more about PostgreSQL than he does

Re: [GENERAL] Weird unique constraint

2010-05-12 Thread Thom Brown
On 12 May 2010 08:09, Mike Christensen wrote: > By golly you're right; maybe I should try this stuff before I email > hundreds of people :) > > > Nah, gives us something to read :) Thom

Re: [GENERAL] Weird unique constraint

2010-05-12 Thread Mike Christensen
By golly you're right; maybe I should try this stuff before I email hundreds of people :) On Wed, May 12, 2010 at 12:00 AM, Thom Brown wrote: > On 12 May 2010 07:34, Mike Christensen wrote: >> >> I have the following constraint which almost works: >> >> ALTER TABLE ingredientforms ADD CONSTRAINT

Re: [GENERAL] Weird unique constraint

2010-05-12 Thread A. Kretschmer
In response to Mike Christensen : > I have the following constraint which almost works: > > ALTER TABLE ingredientforms ADD CONSTRAINT > ingredientforms_UniqueIngredientForm UNIQUE(IngredientId, > FormDisplayName); > > However, I want to allow rows that have the same IngredientId > FormDisplayNam

Re: [GENERAL] Weird unique constraint

2010-05-12 Thread Thom Brown
On 12 May 2010 07:34, Mike Christensen wrote: > I have the following constraint which almost works: > > ALTER TABLE ingredientforms ADD CONSTRAINT > ingredientforms_UniqueIngredientForm UNIQUE(IngredientId, > FormDisplayName); > > However, I want to allow rows that have the same IngredientId > Fo

Re: [GENERAL] Weird unique constraint

2010-05-12 Thread Thom Brown
On 12 May 2010 07:34, Mike Christensen wrote: > I have the following constraint which almost works: > > ALTER TABLE ingredientforms ADD CONSTRAINT > ingredientforms_UniqueIngredientForm UNIQUE(IngredientId, > FormDisplayName); > > However, I want to allow rows that have the same IngredientId > Fo

[GENERAL] Weird unique constraint

2010-05-11 Thread Mike Christensen
I have the following constraint which almost works: ALTER TABLE ingredientforms ADD CONSTRAINT ingredientforms_UniqueIngredientForm UNIQUE(IngredientId, FormDisplayName); However, I want to allow rows that have the same IngredientId FormDisplayName /iff/ FormDisplayName is null. If FormDisplayNa