X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id CEBBA9F9C18 for ; Mon, 8 May 2006 05:42:12 -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 90890-05 for ; Mon, 8 May 2006 05:42:08 -0300 (ADT) X-Greylist: delayed 00:37:29.169313 by SQLgrey- Received: from smtp.nildram.co.uk (smtp.nildram.co.uk [195.112.4.54]) by postgresql.org (Postfix) with ESMTP id 416179F9C9E for ; Mon, 8 May 2006 05:42:08 -0300 (ADT) Received: from demolish1 (unknown [84.12.180.48]) by smtp.nildram.co.uk (Postfix) with SMTP id DD39E35C630 for ; Mon, 8 May 2006 09:04:33 +0100 (BST) Message-ID: <001201c67276$0bc62440$0264a8c0@demolish1> From: "Donald Fraser" To: "[ADMIN]" Subject: Constraint Triggers Date: Mon, 8 May 2006 09:04:35 +0100 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_000F_01C6727E.6D456CF0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.498 tagged_above=0 required=5 tests=BAYES_50, HTML_40_50, HTML_MESSAGE X-Spam-Level: X-Archive-Number: 200605/65 X-Sequence-Number: 21597 This is a multi-part message in MIME format. ------=_NextPart_000_000F_01C6727E.6D456CF0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I'm looking for a way to create a trigger function that gets called once = per transaction as an AFTER EVENT. Because there is no option for creating such a trigger function I was = looking at the "create constraint trigger" command. My approach would be to check the current transaction id to ensure that = I only execute the function once per transaction and if it was deferred = it would happen at the end of the transaction which would simulate an = AFTER EVENT. Apart from the obvious backup and restore problems can anyone think of = any undesired side effects if I used this command? Thanks in advance, Donald Fraser ------=_NextPart_000_000F_01C6727E.6D456CF0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
I'm looking for a way to create a trigger function = that gets=20 called once per transaction as an AFTER EVENT.
Because there is no option for = creating such=20 a trigger function I was looking at the "create constraint trigger" = command.
 
My approach would be to check the current = transaction id to=20 ensure that I only execute the function once per transaction and = if it=20 was deferred it would happen at the end of the transaction which=20 would simulate an AFTER EVENT.
 
Apart from the obvious backup and restore problems = can anyone=20 think of any undesired side effects if I used this command?
 
Thanks in advance,
Donald Fraser
------=_NextPart_000_000F_01C6727E.6D456CF0--