From: Jim C. Nasby <decibel@decibel.org>
To: Mark Steben <msteben@autorevenue.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: update within trigger function
Date: Mon, 23 Jul 2007 18:42:36 -0500
Message-ID: <20070723234236.GH39272@nasby.net> (raw)
In-Reply-To: <001501c7cd54$089c33b0$b501a8c0@D1RPQZB1>
References: <001501c7cd54$089c33b0$b501a8c0@D1RPQZB1>
On Mon, Jul 23, 2007 at 02:05:20PM -0400, Mark Steben wrote:
> 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?
See NEW on
http://www.postgresql.org/docs/8.2/interactive/plpgsql-trigger.html
--
Jim Nasby decibel@decibel.org
EnterpriseDB http://enterprisedb.com 512.569.9461 (cell)
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-admin@postgresql.org
Cc: decibel@decibel.org, msteben@autorevenue.com
Subject: Re: update within trigger function
In-Reply-To: <20070723234236.GH39272@nasby.net>
* 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