X-Original-To: pgsql-sql-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 125E49FB2C4 for ; Tue, 19 Sep 2006 16:04:32 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 30782-02-4 for ; Tue, 19 Sep 2006 16:04:22 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.184]) by postgresql.org (Postfix) with ESMTP id E27DA9FB316 for ; Tue, 19 Sep 2006 16:00:54 -0300 (ADT) Received: by nf-out-0910.google.com with SMTP id p77so257724nfc for ; Tue, 19 Sep 2006 12:00:52 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type; b=VEDvdS2APRwokxP3a6rsbFbuODrtgRf8D6C0pgCeInqVs6S1Qz8DAUkBFfq5G116FB3rcIlnrh2jICS2rWS/xGaL/Uh321HvObLGyoHnQ0gN2AF8Zg4cSxf+axTzeixoZI9huA0k8AI2PYzxH8h4hhrSV0h+6k6F/or0wfGp5LM= Received: by 10.49.43.2 with SMTP id v2mr18756869nfj; Tue, 19 Sep 2006 12:00:52 -0700 (PDT) Received: by 10.48.243.12 with HTTP; Tue, 19 Sep 2006 12:00:52 -0700 (PDT) Message-ID: <2bffcc330609191200l5e84ec23x8db6b7beb89532e5@mail.gmail.com> Date: Tue, 19 Sep 2006 15:00:52 -0400 From: "Henry Ortega" To: pgsql-sql@postgresql.org Subject: Make Trigger run after completion of ENTIRE transaction MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_405614_14323452.1158692452381" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.464 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, HTML_30_40, HTML_MESSAGE, SPF_PASS X-Spam-Level: X-Archive-Number: 200609/133 X-Sequence-Number: 26344 ------=_Part_405614_14323452.1158692452381 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline 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? ------=_Part_405614_14323452.1158692452381 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline
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?
------=_Part_405614_14323452.1158692452381--