Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 260A49FB7FC for ; Mon, 23 Jul 2007 15:07:13 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 98143-06 for ; Mon, 23 Jul 2007 15:06:47 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from mail.autorevenue.com (ip-208.178.167.106.gblx.net [208.178.167.106]) by postgresql.org (Postfix) with ESMTP id 8BF2C9FB7BD for ; Mon, 23 Jul 2007 15:06:49 -0300 (ADT) Received: (qmail 17935 invoked from network); 23 Jul 2007 14:10:00 -0400 Received: from unknown (HELO D1RPQZB1) (msteben@192.168.1.181) by mail.autorevenue.com with SMTP; 23 Jul 2007 14:10:00 -0400 From: "Mark Steben" To: Subject: update within trigger function Date: Mon, 23 Jul 2007 14:05:20 -0400 Message-ID: <001501c7cd54$089c33b0$b501a8c0@D1RPQZB1> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0016_01C7CD32.818A93B0" X-Mailer: Microsoft Office Outlook 11 Thread-Index: AcfNVAh2rh+9J9d1Qzm2rq30SeXkKA== X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.2929 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.024 tagged_above=0 required=5 tests=AWL=0.022, BAYES_50=0.001, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200707/248 X-Sequence-Number: 26229 This is a multi-part message in MIME format. ------=_NextPart_000_0016_01C7CD32.818A93B0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hello listers, We have 'table a' which has defined to it an 'after insert or update' trigger function That inserts to 'table b', obviously for every update or insert of table a. The challenge I have now is to update a new date column on 'table a' with a value coming out of Another inhouse written function within the trigger function. But I cannot use the UPDATE statement within the update trigger function for fear of an infinite loop. All I need to do is to populate the date field of the row that is currently being processed by the trigger function. Is there a command within plpgsql that can help me with this? This seems like an elementary question, but I am a very elementary user of Postgres functions. Thank you for your time, Mark Steben Senior Database Administrator @utoRevenueT A Dominion Enterprises Company 480 Pleasant Street Suite B200 Lee, MA 01238 413-243-4800 Home Office 413-243-4809 Corporate Fax msteben @autorevenue.com Visit our new website at www.autorevenue.com IMPORTANT: The information contained in this e-mail message is confidential and is intended only for the named addressee(s). If the reader of this e-mail message is not the intended recipient (or the individual responsible for the delivery of this e-mail message to the intended recipient), please be advised that any re-use, dissemination, distribution or copying of this e-mail message is prohibited. If you have received this e-mail message in error, please reply to the sender that you have received this e-mail message in error and then delete it. Thank you. ------=_NextPart_000_0016_01C7CD32.818A93B0 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hello listers,

 

We have ‘table a’ which has defined to it an = ‘after insert or update’ trigger function

That inserts to ‘table b’, obviously for every = update or insert of table a.  The challenge

I have now is to update a new date column on ‘table = a’ with a value coming out of

Another inhouse written function within the trigger = function.  But I cannot use the UPDATE

statement within the update trigger function for fear of an = infinite loop. 

All I need to do is to populate the date field of the row that = is currently being processed by the trigger function.  =

Is there a command within plpgsql that can help me with = this?

 

This seems like an elementary question, but I am a very = elementary user of

Postgres functions.  Thank you for your = time,

 

Mark Steben

Senior Database Administrator
@utoRevenue™
A Dominion = Enterprises Company
480 = Pleasant Street
Suite = B200
Lee, MA 01238
413-243-4800 Home Office 
413-243-4809 Corporate Fax

msteben@autorevenue.com

Visit our = new website at
www.autorevenue.com

 

IMPORTANT: The information = contained in this e-mail message is confidential and is intended only for the named addressee(s). If the reader of this e-mail message is not the intended recipient (or the individual responsible for the delivery of this e-mail message to the intended recipient), please be advised that any re-use, dissemination, distribution or copying of this e-mail message is = prohibited.  If you have received this e-mail message in error, please reply to = the sender that you have received this e-mail message in error and then = delete it.  Thank you.

 

------=_NextPart_000_0016_01C7CD32.818A93B0--