Re: Old values in statement triggers? - Mailing list pgsql-general

From Josh Kupershmidt
Subject Re: Old values in statement triggers?
Date
Msg-id AANLkTinxKgSx91a_xcrYCcVxfG-nvu03TrPxOq1H2dLY@mail.gmail.com
Whole thread Raw
In response to Re: Old values in statement triggers?  (Grzegorz Jaśkiewicz <gryzman@gmail.com>)
Responses Re: Old values in statement triggers?
List pgsql-general
2010/10/21 Grzegorz Jaśkiewicz <gryzman@gmail.com>:
> OLD.column_name
> NEW.column_name ?

I believe OP is asking specifically about statement-level triggers. As
the docs <http://www.postgresql.org/docs/current/static/trigger-definition.html>
say:

| Statement-level triggers do not currently have any way to
| examine the individual row(s) modified by the statement.

What I've done is to have a row-level trigger that populates a
temporary table with "interesting" changes that need further
processing, and then a statement-level trigger which does bulk-updates
based on what's in that temporary table. This comes in quite handy
when bulk-loading data, e.g. with COPY.

Josh

pgsql-general by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: 9.0 SSL renegotiation failure restoring data
Next
From: Adrian Klaver
Date:
Subject: Re: a query on stored procedures/functions in pgsql