I have a problem in a number of my tables. I'd like to add uniqueness constraints across multiple columns, but some of the columns are nullable. This gives me trouble since when I create a constraint on columns A and B.. I'd like the constraint to be enforced such that you couldn't insert values ("value for A", null) twice. I understand why the constraints work this way, but I'm wondering if anyone knows of a workaround.

Feel free to spare me any "don't use nullable columns" responses. I of course am aware that is an option. It's just one I'm hoping to avoid as this is a legacy database and it would be a mammoth effort to accomplish.

Thank you in advance!

Phill

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
      choose an index scan if your joining column's datatypes do not
      match

Reply via email to