Re: Rule ON DELETE, to perform to DELETE querys !

From: Luis Sousa <llsousa(at)ualg(dot)pt>
To: pgsql Admin Mailing List <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Rule ON DELETE, to perform to DELETE querys !
Date: 2001-06-08 15:31:13
Message-ID: 3B20EFC1.18C29C72@ualg.pt
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Sorry, but it wasn't this list that i wanted to send this post !!

I already send it to pgsql-sql(at)postgresql(dot)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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2001-06-08 17:03:25 Re: Rule ON DELETE, to perform to DELETE querys !
Previous Message Luis Sousa 2001-06-08 13:13:31 Rule ON DELETE, to perform to DELETE querys !