pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Henry Ortega <juandelacruz@gmail.com>
To: pgsql-sql@postgresql.org
Subject: Make Trigger run after completion of ENTIRE transaction
Date: Tue, 19 Sep 2006 15:00:52 -0400
Message-ID: <2bffcc330609191200l5e84ec23x8db6b7beb89532e5@mail.gmail.com> (raw)

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?

view thread (2+ messages)  latest in thread

Message-ID: <2bffcc330609191200l5e84ec23x8db6b7beb89532e5@mail.gmail.com>
Permalink:  ../2bffcc330609191200l5e84ec23x8db6b7beb89532e5@mail.gmail.com/
Also on:    postgresql.org/message-id/2bffcc330609191200l5e84ec23x8db6b7beb89532e5@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: juandelacruz@gmail.com
  Subject: Re: Make Trigger run after completion of ENTIRE transaction
  In-Reply-To: <2bffcc330609191200l5e84ec23x8db6b7beb89532e5@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox