Re: assertions and constraint triggers

Поиск
Список
Период
Сортировка
Искать
От
Tom Lane
Тема
Re: assertions and constraint triggers
Дата
Msg-id
4307.1281903175@sss.pgh.pa.us
Ответ на
Список
Дерево обсуждения
assertions and constraint triggers Peter Eisentraut <peter_e@gmx.net>
Re: assertions and constraint triggers Simon Riggs <simon@2ndQuadrant.com>
Re: assertions and constraint triggers Tom Lane <tgl@sss.pgh.pa.us>
Re: assertions and constraint triggers Marko Tiikkaja <marko.tiikkaja@cs.helsinki.fi>
Re: assertions and constraint triggers Peter Eisentraut <peter_e@gmx.net>
Re: assertions and constraint triggers Marko Tiikkaja <marko.tiikkaja@cs.helsinki.fi>
Re: assertions and constraint triggers Peter Eisentraut <peter_e@gmx.net>
Re: assertions and constraint triggers "Kevin Grittner" <Kevin.Grittner@wicourts.gov>
Re: assertions and constraint triggers Tom Lane <tgl@sss.pgh.pa.us>
Re: assertions and constraint triggers Peter Eisentraut <peter_e@gmx.net>
Re: assertions and constraint triggers Nicolas Barbier <nicolas.barbier@gmail.com>
Peter Eisentraut  writes:
> 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.

On further reflection it seems like the major implementation problem
would be to identify "the affected tables".  What if the assertion
references views, or user-defined functions that contain queries?
Even an assertion on a table with inheritance children would be a
bit problematic.  In principle you could handle the latter case by
propagating copies of the trigger to all the children, but we have
no mechanism for that now.
		regards, tom lane

В списке pgsql-hackers по дате отправления
От: Andres Freund
Дата:
От: Heikki Linnakangas
Дата:
FAQ