On Wed, 2010-08-11 at 08:31 +0300, Peter Eisentraut wrote:
> Thinking about SQL assertions (check constraints that are independent of
> one particular table), do you think it would be reasonable to implement
> those on top of constraint triggers? On creation you'd hook up a
> trigger to each of the affected tables. And the trigger function runs
> the respective check expression. Conceptually, this doesn't seem to be
> very far away from foreign key constraints after all.
I would be interested in virtual assertions, i.e. allowing the user to
say it is true without it being enforced.
The cost of executing enforced assertions is likely to be prohibitive.
Most common use case if you do have them is the equivalent of
minoccurs/maxoccurs constraints in an XML Schema definition (XSD).
-- Simon Riggs www.2ndQuadrant.comPostgreSQL Development, 24x7 Support, Training and Services