Re: Stored Procedure and Trigger they puzzle me
От | Albe Laurenz |
---|---|
Тема | Re: Stored Procedure and Trigger they puzzle me |
Дата | |
Msg-id | 52EF20B2E3209443BC37736D00C3C1380BF426C7@EXADV1.host.magwien.gv.at обсуждение исходный текст |
Ответ на | Stored Procedure and Trigger they puzzle me (Lars Heidieker <lars@heidieker.de>) |
Ответы |
Re: Stored Procedure and Trigger they puzzle me
|
Список | pgsql-general |
> Actually I just figured out, that is is not the trigger but the two > cascade on update triggers collide. > It happens also without the trigger: > > lt=# UPDATE ltlocation SET id = 45555 WHERE id = 18999; > ERROR: insert or update on table "ltlocationpath" violates foreign > key constraint "ltlocancester_fkey" > DETAIL: Key (ltlocancester_id)=(18999) is not present in table > "ltlocation". > CONTEXT: SQL statement "UPDATE ONLY "public"."ltlocationpath" SET > "ltlocation_id" = $1 WHERE "ltlocation_id" = $2" > > I think the two foreign key constraints together make it impossible > to change the primary key (which isn't needed), > as they would have to run "as one" which they can't... The two foreign key constraints worked fine when I tried them, the only problem was the trigger. I don't get what you describe. Have you changed anything in the definitions? If yes, post table, key, and trigger definitions as you have them now. Yours, Laurenz Albe
В списке pgsql-general по дате отправления: