Re: assertions and constraint triggers

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: assertions and constraint triggers
Date: 2010-08-11 08:02:17
Message-ID: 1281513737.2142.1477.camel@ebony
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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.com
PostgreSQL Development, 24x7 Support, Training and Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Nicolas Barbier 2010-08-11 08:08:59 Re: assertions and constraint triggers
Previous Message Vik Reykja 2010-08-11 08:00:31 Re: Regression tests versus the buildfarm environment