Make Trigger run after completion of ENTIRE transaction - Mailing list pgsql-sql

From Henry Ortega
Subject Make Trigger run after completion of ENTIRE transaction
Date
Msg-id 2bffcc330609191200l5e84ec23x8db6b7beb89532e5@mail.gmail.com
Whole thread Raw
Responses Re: Make Trigger run after completion of ENTIRE transaction
List pgsql-sql
This maybe more of a theoretical question, can you actually make a Trigger run
after completion of the entire transaction?
 
Here's what I have:
LOG
user   |    startdate       |       enddate
 
enddate is getting updated by a trigger (on insert or update).
 
I have the following transaction:
BEGIN;
Insert into LOG(user,startdate) values('jdoe','2006-08-13');
Insert into LOG(user,startdate) values('jdoe','2006-08-14');
Insert into LOG(user,startdate) values('jdoe','2006-08-15');
Insert into LOG(user,startdate) values('jdoe','2006-08-16');
Insert into LOG(user,startdate) values('jdoe','2006-08-17');
........... another 20-30 more inserts..........
COMMIT;
 
The trigger actually runs on each Insert and therefore slows down the
Insert quite a bit.
 
My question is, can you tell the trigger to run after Commit?

pgsql-sql by date:

Previous
From: CG
Date:
Subject: Re: Nested loops are killing throughput
Next
From: Tom Lane
Date:
Subject: Re: Nested loops are killing throughput