Re: assertions and constraint triggers

Поиск
Список
Период
Сортировка
От Simon Riggs
Тема Re: assertions and constraint triggers
Дата
Msg-id 1281513737.2142.1477.camel@ebony
обсуждение исходный текст
Ответ на assertions and constraint triggers  (Peter Eisentraut <peter_e@gmx.net>)
Список 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.comPostgreSQL Development, 24x7 Support, Training and Services



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Vik Reykja
Дата:
Сообщение: Re: Regression tests versus the buildfarm environment
Следующее
От: Nicolas Barbier
Дата:
Сообщение: Re: assertions and constraint triggers