I want to create a constraint that's a little different, but don't know how to implement it. I have an intermediate table with a compound PK and a boolean 'ysnDefault' column:

  comanyID     INTEGER REFERENCES companies,
  assocationID INTEGER REFERENCES associations,
  ysnDefault     BOOLEAN

I just want to constrain the ysnDefault field to only allow one TRUE value for any companyID/associationID pair, with no restrictions on the number of FALSES.

At first glance I thought it would be easy, but I can't see how to do it. Any suggestions?

Thanks
Ron



---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Reply via email to