Received: from mozart.si.ualg.pt (mozart.si.ualg.pt [193.136.224.2]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f58FVJE37560 for ; Fri, 8 Jun 2001 11:31:19 -0400 (EDT) (envelope-from llsousa@ualg.pt) Received: from ualg.pt (llsousa@corisco.uceh.ualg.pt [10.10.20.126]) by mozart.si.ualg.pt (8.9.1/8.9.1) with ESMTP id QAA215836 for ; Fri, 8 Jun 2001 16:31:13 +0100 (WEST) Message-ID: <3B20EFC1.18C29C72@ualg.pt> Date: Fri, 08 Jun 2001 16:31:13 +0100 From: Luis Sousa Organization: Universidade do Algarve X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.2.17-compact i686) X-Accept-Language: en, pt MIME-Version: 1.0 To: pgsql Admin Mailing List Subject: Re: Rule ON DELETE, to perform to DELETE querys ! References: <3B20CF7B.24396094@ualg.pt> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200106/53 X-Sequence-Number: 1591 Sorry, but it wasn't this list that i wanted to send this post !! I already send it to pgsql-sql@postgresql.org !! Luis Sousa wrote: > 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 > WHERE id = 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 > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster