Received: from txino.mikasa.eh (9-ZARA-X28.libre.retevision.es [62.82.239.9]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f318GdK67607 for ; Sun, 1 Apr 2001 04:16:40 -0400 (EDT) (envelope-from txino@wanadoo.es) Received: by txino.mikasa.eh (Postfix, from userid 502) id 827A275CE2; Sun, 1 Apr 2001 10:09:39 +0200 (CEST) From: "J.Fernando Moyano" Date: Sun, 1 Apr 2001 10:09:38 +0200 X-Mailer: KMail [version 1.1.99] Content-Type: text/plain; charset="iso-8859-1" To: pgsql-sql@postgresql.org Subject: ON DELETE rule MIME-Version: 1.0 Message-Id: <01040110093800.01615@txino.mikasa.eh> Content-Transfer-Encoding: 8bit X-Archive-Number: 200104/2 X-Sequence-Number: 2341 I'm trying to do something like this: CREATE RULE piezas_delete AS ON delete TO piezas DO update materia_prima set usadas=(usadas-1) where n_material=old.n_material; The rule is created. OK .... but the action doesn't run like it's supossed. ¿What is wrong? Is "old" usable with "ON DELETE" rules ??? I think delete action its performed AFTER rule action .... ¿OK? So ... it's possible to access field values of delete affectted registers? -- Fernando Moyano Frase del día: -------------- No hay cita. Solo son imaginaciones tuyas!!. (*) SymeX ==> http://symex.lantik.com (*) WDBIL ==> http://wdbil.sourceforge.net (*) Informate sobre LINUX en http://www.linux.org