Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id E05319FB1CA for ; Mon, 23 Jul 2007 20:42:58 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 66172-05 for ; Mon, 23 Jul 2007 20:42:50 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) by postgresql.org (Postfix) with ESMTP id 432359FA37B for ; Mon, 23 Jul 2007 20:42:55 -0300 (ADT) Received: by noel.decibel.org (Postfix, from userid 1001) id C2A70564CD; Mon, 23 Jul 2007 18:42:38 -0500 (CDT) Received: (hashcash-sendmail, from uid 1001); Mon, 23 Jul 2007 18:42:36 -0500 Date: Mon, 23 Jul 2007 18:42:36 -0500 From: "Jim C. Nasby" To: Mark Steben Cc: pgsql-admin@postgresql.org Subject: Re: update within trigger function Message-ID: <20070723234236.GH39272@nasby.net> References: <001501c7cd54$089c33b0$b501a8c0@D1RPQZB1> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="W5Yj4BWVzBU0tpZR" Content-Disposition: inline In-Reply-To: <001501c7cd54$089c33b0$b501a8c0@D1RPQZB1> X-Operating-System: FreeBSD 6.1-RELEASE-p10 amd64 X-Distributed: Join the Effort! http://www.distributed.net User-Agent: Mutt/1.5.13 (2006-08-11) X-Hashcash: 1:20:070723:msteben@autorevenue.com::zof0BWEahCJV1t00:00000000000000 0000000000000000000000001B6P X-Hashcash: 1:20:070723:pgsql-admin@postgresql.org::5t3sB86cctkVeqnJ:00000000000 00000000000000000000000012RC X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200707/254 X-Sequence-Number: 26235 --W5Yj4BWVzBU0tpZR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 >=20 > That inserts to 'table b', obviously for every update or insert of table = a. > The challenge >=20 > I have now is to update a new date column on 'table a' with a value coming > out of >=20 > Another inhouse written function within the trigger function. But I cann= ot > use the UPDATE=20 >=20 > statement within the update trigger function for fear of an infinite loop= =2E =20 >=20 > All I need to do is to populate the date field of the row that is current= ly > being processed by the trigger function. =20 >=20 > 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 --=20 Jim Nasby decibel@decibel.org EnterpriseDB http://enterprisedb.com 512.569.9461 (cell) --W5Yj4BWVzBU0tpZR Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.3 (FreeBSD) iD8DBQFGpTzsdO30qud8SkgRAh8gAJ9ndSioAcjyBWLCr/U7Pp7Z9zWv4QCfdGoN 5H1Iv4VfOsrg4dnQb96bQYs= =wf7x -----END PGP SIGNATURE----- --W5Yj4BWVzBU0tpZR--