Re: Delete cascade with three levels bug ?

Поиск
Список
Период
Сортировка
От Euler Taveira de Oliveira
Тема Re: Delete cascade with three levels bug ?
Дата
Msg-id 4AE70696.9050501@timbira.com
обсуждение исходный текст
Ответ на Delete cascade with three levels bug ?  (Marcelo Costa <marcelojscosta@gmail.com>)
Ответы Re: Delete cascade with three levels bug ?  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Marcelo Costa escreveu:
> Hi, hackers
> 
> I have a problem at PostgreSQL 8.3.5 (Slackware Server and Win 2003
> Server) SO independent.
> 
> When run the scripts below I receive the error:
> 
This is not a bug. There are many ways to shoot yourself in the foot; and it
is one of them...

> UPDATE pg_trigger SET tgdeferrable = TRUE, tginitdeferred = TRUE;
> 
This query will defer all of the triggers, including the cascade ones. If you
compiles with --enable-cassert you will see:

TRAP: FailedAssertion("!(afterTriggers->query_depth >= 0)", Arquivo:
"/a/pgsql/src/backend/commands/trigger.c", Linha: 3893)

Why don't you use the syntax (DEFERRABLE and INITIALLY DEFERRED)? That will do
the Right Thing (TM).

BTW, is it worth preventing such a crash putting an elog message in trigger.c?


--  Euler Taveira de Oliveira http://www.timbira.com/


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

Предыдущее
От: Marcelo Costa
Дата:
Сообщение: Delete cascade with three levels bug ?
Следующее
От: Tom Lane
Дата:
Сообщение: FOR UPDATE versus WITH --- change 8.4 too?