Make Trigger run after completion of ENTIRE transaction
| От | Henry Ortega |
|---|---|
| Тема | Make Trigger run after completion of ENTIRE transaction |
| Дата | |
| Msg-id | 2bffcc330609191200l5e84ec23x8db6b7beb89532e5@mail.gmail.com обсуждение исходный текст |
| Ответы |
Re: Make Trigger run after completion of ENTIRE transaction
|
| Список | 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 по дате отправления: