I'd like to add a constraint which enforces uniqueness on a column only in a portion of a table.
ALTER TABLE stop ADD CONSTRAINT myc UNIQUE (col_a) WHERE (col_b is null);
The WHERE
part above is wishful thinking.
Any way of doing this? Or should I go back to the relational drawing board?