Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id D7D402E0047 for ; Wed, 7 May 2008 11:49:10 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 61698-10 for ; Wed, 7 May 2008 11:49:00 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mailsrv1.zmi.at (mailsrv1.zmi.at [212.69.162.198]) by developer.postgresql.org (Postfix) with ESMTP id C628F2E0042 for ; Wed, 7 May 2008 11:49:06 -0300 (ADT) Received: from mailsrv.i.zmi.at (h081217054243.dyn.cm.kabsi.at [81.217.54.243]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mailsrv.i.zmi.at", Issuer "mailsrv.i.zmi.at" (not verified)) by mailsrv1.zmi.at (Postfix) with ESMTP id D0B8BC2E for ; Wed, 7 May 2008 16:49:36 +0200 (CEST) Received: from saturn.i.zmi.at (saturn.i.zmi.at [10.0.0.2]) by mailsrv.i.zmi.at (Postfix) with ESMTP id E4F13BFE9 for ; Wed, 7 May 2008 16:48:05 +0200 (CEST) From: Michael Monnerie Organization: it-management http://it-management.at To: pgsql-admin@postgresql.org Subject: Re: column: on update update? Date: Wed, 7 May 2008 16:49:03 +0200 User-Agent: KMail/1.9.6 (enterprise 20070904.708012) References: <200805071050.41450@zmi.at> <396486430805070623p360b8eafp39683a287cdb3cc@mail.gmail.com> In-Reply-To: <396486430805070623p360b8eafp39683a287cdb3cc@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart8854530.sy9rH7N5HH"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200805071649.03336@zmi.at> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.012 tagged_above=0 required=5 tests=AWL=0.012 X-Spam-Level: X-Archive-Number: 200805/50 X-Sequence-Number: 29134 --nextPart8854530.sy9rH7N5HH Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Mittwoch, 7. Mai 2008 Richard Broersma wrote: > Well you have two options. =A0The perferred method would be to have > your application include an update to your lastupdate field whenever > anyother rows are updated. But as we speak about SpamAssassin, an external project, I do not want=20 to patch every new version that comes out. Maybe they include it once,=20 but it isn't currently so I need the db do it. > the other option is to add an after update trigger, and manually set > lastupdate then. Would that be correct? I never did it and looked purely into docs: CREATE FUNCTION awlupdate() AS 'UPDATE awl SET lastupdate=3DCURRENT_TIMESTAMP;' LANGUAGE SQL; CREATE TRIGGER awlupdate AFTER UPDATE ON awl FOR EACH ROW EXECUTE PROCEDURE awlupdate(); mfg zmi =2D-=20 // Michael Monnerie, Ing.BSc ----- http://it-management.at // Tel: 0676/846 914 666 .network.your.ideas. // PGP Key: "curl -s http://zmi.at/zmi.asc | gpg --import" // Fingerprint: AC19 F9D5 36ED CD8A EF38 500E CE14 91F7 1C12 09B4 // Keyserver: www.keyserver.net Key-ID: 1C1209B4 --nextPart8854530.sy9rH7N5HH Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4-svn0 (GNU/Linux) iD8DBQBIIcFfzhSR9xwSCbQRAsMEAKCMHwhB8LjN8bFU2UU8B2Yzcr2IFwCgoYo1 dkw6KWtNIf06cHK96Y/lde4= =Kany -----END PGP SIGNATURE----- --nextPart8854530.sy9rH7N5HH--