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>)
Список pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> 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
Дата:
Сообщение: Re: Cost of AtEOXact_Buffers in --enable-cassert
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: DropRelFileNodeBuffers API change (was Re: [BUGS] BUG #5599: Vacuum fails due to index corruption issues)