Re: [SQL] uniqueness constraint with NULLs
In response to Robert Edwards : > Can anyone suggest a way that I can impose uniqueness on a and b when > c is NULL? Sure, use a functional index: test=# create table bobtest (a int, b int, c int); CREATE TABLE test=*# create unique index idx_bobtest on bobtest(a,b,coalesce(c::text,'NULL')); CREA
[SQL] uniqueness constraint with NULLs
I have a table with a uniqueness constraint on three columns: # \d bobtest Table "public.bobtest" Column | Type | Modifiers +-+-- id | integer | not null default nextval('bob