Re: Statement level triggers

From: Harald Fuchs <hari(dot)fuchs(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Statement level triggers
Date: 2010-01-20 18:08:30
Message-ID: puhbqgbqe9.fsf@srv.protecting.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

In article <4B5702B9(dot)50706(at)postnewspapers(dot)com(dot)au>,
Craig Ringer <craig(at)postnewspapers(dot)com(dot)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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Filip Rembiałkowski 2010-01-20 18:13:52 Re: About partitioning
Previous Message Vincenzo Romano 2010-01-20 17:12:39 Re: About partitioning