pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Martín Marqués <martin@bugs.unl.edu.ar>
Cc: pgsql sql Mailing List <pgsql-sql@postgresql.org>
Subject: Re: loop on a rule
Date: Tue, 07 Aug 2001 19:53:58 -0400
Message-ID: <29386.997228438@sss.pgh.pa.us> (raw)
In-Reply-To: <01080719220707.11074@bugs>
References: <01080719220707.11074@bugs>

=?iso-8859-1?q?Mart=EDn=20Marqu=E9s?= <martin@bugs.unl.edu.ar> writes:
> As I said before, I am playing around with views and rules, and found out 
> that I have something wrong in one of the rules. My delete rule says 
> something like this:

> CREATE RULE admin_delete AS ON
> DELETE TO admin_view
> DO INSTEAD (
>    DELETE FROM carrera WHERE id_curso=old.id_curso;
>    DELETE FROM inscripcion WHERE carrera=old.id_curso;
>    DELETE FROM resol WHERE carr=old.id_curso;
>    DELETE FROM modalidad WHERE carrera=old.id_curso;
>    INSERT INTO log_carrera (accion,tabla) VALUES ('D','carrera');
> );

I think you need the patch for multi-action rules --- see
http://www.ca.postgresql.org/cgi/cvsweb.cgi/pgsql/src/backend/rewrite/rewriteHandler.c
You need version 1.93.2.1, assuming that you're on PG 7.1.2.

			regards, tom lane



view thread (3+ messages)  latest in thread

Message-ID: <29386.997228438@sss.pgh.pa.us>
Permalink:  ../29386.997228438@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/29386.997228438@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, martin@bugs.unl.edu.ar
  Subject: Re: loop on a rule
  In-Reply-To: <29386.997228438@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox