RULES

From: "J(dot)Fernando Moyano" <txinete(at)wanadoo(dot)es>
To: pgsql-sql(at)postgresql(dot)org
Subject: RULES
Date: 2001-05-22 17:19:00
Message-ID: 01052213190000.01962@txino.mikasa.eh
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Well ... i'm testing carefully the two rules ==>

CREATE RULE piezas_add AS
ON insert TO piezas
DO update materia_prima set usadas=(usadas+1)
where n_material=new.n_material;

CREATE RULE piezas_delete AS
ON delete TO piezas
DO update materia_prima set usadas=(usadas-1)
where n_material=old.n_material;

Inserting is OK.
Deleting is broken if it deletes more than one row. The rule is executed only
one time each delete command, and not one time each deleted row.

It's this OK ??? Am i wrong ???
It's a "feature" ?? ;-)

Thanks

- --
Fernando Moyano

Frase del día:
- --------------
¡CocaCola esasín! ¡prrrrrrrrrts, bruuuuuuuups!

(*) SymeX ==> http://symex.lantik.com
(*) WDBIL ==> http://wdbil.sourceforge.net
(*) Informate sobre LINUX en http://www.linux.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE7Cp+HoZaf9MvtDvcRAqV/AKCQLhl34VF3sfPt3O5i5w5MFpcZRQCgmm5b
duRciSRJhzTJLuhFrNLUcWQ=
=It2U
-----END PGP SIGNATURE-----

Responses

  • Re: RULES at 2001-05-22 07:44:06 from Martín Marqués

Browse pgsql-sql by date

  From Date Subject
Next Message Michael Richards 2001-05-23 05:15:34 index/join madness
Previous Message Peter Eisentraut 2001-05-22 16:09:44 Re: c++ wrapper library