Search Postgresql Archives

Re: Statement level triggers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Vincenzo Romano wrote:
> Hi all.
> 
> What'd be the behavior of a (plpgsql) trigger function when called as
> a statement level trigger?
> Let's say that a statement will involve more than one row.
> The documentation (v8.4.2, "35.1. Overview of Trigger Behavior") says:
> 
> "Statement-level triggers do not currently have any way to examine the
> individual row(s) modified by the statement."

It means you don't have NEW or OLD record-variables. You can still
perform any queries you need to on the table affected and any other
tables of interest.

I find statement-level triggers to be useful mostly for sanity-checking.
I'll have an AFTER statement level trigger verify a certain invariant on
a table - like a table-level CHECK (as opposed to row-level CHECK).

--
Craig Ringer


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux