Search Postgresql Archives

Re: Rule vs Trigger

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

 



>> A trigger FOR EACH STATEMENT will execute the trigger function
>> for each row affacted by the statement.
> 
> Huh?  That would be true for a FOR EACH ROW trigger, but a STATEMENT
> trigger fires once per statement.

Argh. I intended to write FOR EACH ROW.
Thanks for the correction.

>> A rule would only
>> execute one additional statement. So if you can do it with a rule
>> conveniently, the rule will probably be faster.
> 
> I find this unlikely.  The overhead involved in setting up a rule
> is probably larger than that involved in calling a trigger.
> The real question is whether you need access to the modified data
> or not --- a statement-level trigger doesn't currently get that.

Yes, I meant to write about row level triggers, maybe what
I wrote makes more sense then...

What I said was inspired by chapter 35.6. of the documentation.

Yours,
Laurenz Albe


[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