Re: Need help : Weird referencial Integrity triggers
От | Jan Wieck |
---|---|
Тема | Re: Need help : Weird referencial Integrity triggers |
Дата | |
Msg-id | 200010071144.GAA14039@jupiter.jw.home обсуждение исходный текст |
Ответ на | Need help : Weird referencial Integrity triggers ("Vilson farias" <vilson.farias@digitro.com.br>) |
Список | pgsql-general |
Vilson farias wrote: > I've been changing some tables and I saw a strange behavior in pg_trigger. > Check out the commented code below : > > [...] > > Now, if I select the corresponding triggers from pg_trigger, I'll find > three. Why 3? One for update, one for insert and one for delete ? One for INSERT/UPDATE of the foreign key table, one for DELETE and one for UPDATE of the primary key table. You haven't specified a referential action for the UPDATE case of the primary key (ON UPDATE ...). The default action is NO ACTION, what means that changing the primary keys value isn't allowed as long as there are references to it from any foreign key. Thus, updating a PK can never be ignored and there must be a trigger. Jan -- #======================================================================# # It's easier to get forgiveness for being wrong than for being right. # # Let's break this rule - forgive me. # #================================================== JanWieck@Yahoo.com #
В списке pgsql-general по дате отправления: