Adi,
> so it turns out the best I can come up with is to use a function that
> returns a boolean since that works fine in a table constraint:
Constraints should never involve queries against rows other than the one being
updated. This is not guarenteed to be stable, nor to back up and restore
correctly.
Use a trigger instead of a constraint.
--
--Josh
Josh Berkus
Aglio Database Solutions
San Francisco