I would like to add a constraint that ensures uniqueness in a column only in part of the table.
ALTER TABLE stop ADD CONSTRAINT myc UNIQUE (col_a) WHERE (col_b is null);
The part above WHERE is wishful thinking.
Any way to do this? Or do I need to go back to the relational drawing board?
postgresql constraints unique-constraint
EoghanM Apr 26 '13 at 12:22 2013-04-26 12:22
source share