Re: Rules and actions involving multiple rows

From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: Jason Godden <jasongodden(at)optushome(dot)com(dot)au>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Rules and actions involving multiple rows
Date: 2003-07-06 05:39:05
Message-ID: 20030706053905.GA19974@dcc.uchile.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sun, Jul 06, 2003 at 02:48:59PM +1000, Jason Godden wrote:

> In the past I've always used triggers to fire before or after events however I
> see that the same thing can be achieved through rules (for logging etc...) so
> I created a rule which fires on update (not DO INSTEAD) however it only seems
> to work for a single row - whereas the triggers work for all rows updated in
> a transaction.

Rules are a once-per-statement thing, and thus appear to be "for a
single row." Triggers can be once-per-row or once-per-statement. Only
you know what is more appropiate in your scenario...

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Limitate a mirar... y algun dia veras"

In response to

Browse pgsql-general by date

  From Date Subject
Next Message mallah 2003-07-06 06:44:22 Re: PostGreSql equivalents to mssql
Previous Message Jason Godden 2003-07-06 04:48:59 Rules and actions involving multiple rows