Re: Deleting Problem
От | Reece Hart |
---|---|
Тема | Re: Deleting Problem |
Дата | |
Msg-id | 1162255825.4583.96.camel@snafu.site обсуждение исходный текст |
Ответ на | Deleting Problem (Jamie Deppeler <jamie@doitonce.net.au>) |
Список | pgsql-general |
On Tue, 2006-10-31 at 10:24 +1100, Jamie Deppeler wrote:
As Stephen said, it's difficult to help without more details about the triggers and the structure of your transaction. However, if you expect that the constraints are consistent at the end of the transaction, perhaps the problem is merely the order in which constraints are checked. See
http://www.postgresql.org/docs/8.1/interactive/sql-set-constraints.html
and consider something like SET CONSTRAINTS ALL DEFERRED .
-Reece
Here is my problem i have delete triggers on table5 and table6 which
update summary information on table1,table2,table3,table4 if table5 or 6
gets delete, problem i am faced with is when eg table1 record gets
deleted i get the following error Error insert or update on table5
violates foreign key constraint "table4". They are all link with a
cascade delete.
As Stephen said, it's difficult to help without more details about the triggers and the structure of your transaction. However, if you expect that the constraints are consistent at the end of the transaction, perhaps the problem is merely the order in which constraints are checked. See
http://www.postgresql.org/docs/8.1/interactive/sql-set-constraints.html
and consider something like SET CONSTRAINTS ALL DEFERRED .
-Reece
-- Reece Hart, http://harts.net/reece/, GPG:0x25EC91A0 |
В списке pgsql-general по дате отправления: