implied rows when a rule gets executed.

From: "J(dot)Fernando Moyano" <txinete(at)wanadoo(dot)es>
To: pgsql-sql(at)postgresql(dot)org
Subject: implied rows when a rule gets executed.
Date: 2001-05-23 06:24:17
Message-ID: 01052302241703.01962@txino.mikasa.eh
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

In a rule... is there some way of getting the number of rows updated by the
query that activates this rule ??

Martín Marqués says:

>You'll have to do more advance programing there. See if count(*) can help
>you
>in any way.
>I see you have to update usadas=(usadas-1). Try something like:
>
>usadas=(usadas-(select count(*) from piezas WHERE condition_delete) )

... but, how can i know "condition_delete" ???

If there is no way ... i will try with triggers ... but i think it's little
simetrical ..... ==> i can get done my stuff with rules when inserting, but
it isn't possible when deleting ???

Thanks .....

- --
Fernando Moyano

Frase del día:
- --------------
Fuerza tu OS/2 a OS/4!!.

(*) 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

iD8DBQE7C1eRoZaf9MvtDvcRAuqCAJ97HFg61+yJnRgn/Ulkd++paWTWRACfVBXQ
RslGvE5sh1IBYO1s4P36nXo=
=Tlk4
-----END PGP SIGNATURE-----

Browse pgsql-sql by date

  From Date Subject
Next Message Martin Smetak 2001-05-23 09:07:56 Recursive select
Previous Message Michael Richards 2001-05-23 05:15:34 index/join madness