Re: Statement level triggers - Mailing list pgsql-general

From Harald Fuchs
Subject Re: Statement level triggers
Date
Msg-id puhbqgbqe9.fsf@srv.protecting.net
Whole thread Raw
In response to Statement level triggers  (Vincenzo Romano <vincenzo.romano@notorand.it>)
List pgsql-general
In article <4B5702B9.50706@postnewspapers.com.au>,
Craig Ringer <craig@postnewspapers.com.au> writes:

>> 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.

Other databases have NEW and/or OLD pseudo-tables for that.  My
suggestion about implementing that got turned down because, without a
primary key, you can't say which NEW and OLD rows belong to each
other.

Since tables often have a primary key I still think that this would be
an addition making statement-level triggers much more useful than they
are now.

pgsql-general by date:

Previous
From: Ivan Sergio Borgonovo
Date:
Subject: Re: more docs on extending postgres in C
Next
From: Filip Rembiałkowski
Date:
Subject: Re: About partitioning