Triggers and RI-style behavior.

Поиск
Список
Период
Сортировка
От Mike Mascari
Тема Triggers and RI-style behavior.
Дата
Msg-id 01C097F2.80E27B20.mascarm@mascari.com
обсуждение исходный текст
Список pgsql-general
Hello.

I was wondering if anyone could give me an example of a CREATE TRIGGER
statement which mimics the behavior of the integrated R.I. in version 7. I
have the need to create triggers which do some RI-style things but cannot
be declared appropriately using ALTER TABLE ADD CONSTRAINT. I know there
are issues with MVCC which made the old refint.c obsolete. If, for example,
I want to update table2 when a field in table1 changes, should I use a
trigger like:

CREATE TRIGGER t_table1
AFTER UPDATE ON table1
FOR EACH ROW EXECUTE PROCEDURE bar();

where bar() is a PL/pgSQL block to update table2.

Or should it be FOR EACH STATEMENT?

Thanks for any information,

Mike Mascari
mascarm@mascari.com


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

Предыдущее
От: "Joseph"
Дата:
Сообщение: RE: Re: Re: Order question
Следующее
От: "Richard Huxton"
Дата:
Сообщение: Re: function likes sprintf