Rule ON DELETE, to perform to DELETE querys !

Поиск
Список
Период
Сортировка
От Luis Sousa
Тема Rule ON DELETE, to perform to DELETE querys !
Дата
Msg-id 3B20EF24.7EE0CD77@ualg.pt
обсуждение исходный текст
Ответы Re: Rule ON DELETE, to perform to DELETE querys !  (Martín Marqués <martin@bugs.unl.edu.ar>)
Список pgsql-sql
I have a view over a join of tables and when it's performed over the
view a delete i want to delete records in two different tables. The code
that i wrote was:
   CREATE RULE "deletetables" AS ON DELETE TO "tables"        DO INSTEAD (        DELETE FROM table2
WHEREid = OLD.id;        DELETE FROM table1               WHERE id=OLD.id          );
 

table2 references table1 by the field id only for update. I don't them
to be referenced by delete !

When i execute: DELETE FROM tables WHERE id=1; i got these message from
postgres:

pqReadData() -- backend closed the channel unexpectedly.       This probably means the backend terminated abnormally
  before or while processing the request.
 
The connection to the server was lost. Attempting reset: Failed.

The records exists in both tables !!!!!!!

This already happen with some of you ???? How can i do this ????


Thanks

Luis Sousa


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] Re: behavior of ' = NULL' vs. MySQL vs. Standards
Следующее
От: Jonathan Bartlett
Дата:
Сообщение: Re: maximum number of rows in table - what about oid limits?