Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 0B797476446 for ; Thu, 16 May 2002 13:48:00 -0400 (EDT) Received: from davinci.ethosmedia.com (davinci.ethosmedia.com [209.10.40.250]) by postgresql.org (Postfix) with ESMTP id 1BF5C475CAC for ; Thu, 16 May 2002 13:47:49 -0400 (EDT) Received: from [209.122.114.82] (HELO chocolate-mousse) by davinci.ethosmedia.com (CommuniGate Pro SMTP 3.5.9) with ESMTP id 1461910; Thu, 16 May 2002 10:47:48 -0700 Content-Type: text/plain; charset="iso-8859-1" From: Josh Berkus Reply-To: josh@agliodbs.com Organization: Aglio Database Solutions To: Larry Rosenman , pgsql-sql@postgresql.org Subject: Re: trigger question Date: Thu, 16 May 2002 10:49:23 -0700 X-Mailer: KMail [version 1.4] References: <1021570694.95676.7.camel@ler-freebie.iadfw.net> In-Reply-To: <1021570694.95676.7.camel@ler-freebie.iadfw.net> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200205161049.23148.josh@agliodbs.com> X-Archive-Number: 200205/164 X-Sequence-Number: 7800 Larry, > Is there a way in PL/pgSQL to have a trigger look at the fields in a > %ROWTYPE variable to look for changes?=20 >=20 > I'm looking to be able to log the fields that are different between old > and new in a trigger, but don't want to have to list each field (It > changes, occasionally, but it changes). I'd also like to add a > timestamp and flag field when I store the record in the log table.=20 >=20 > Am I just SOL, or is there a way to do this? (7.2.1, if it matters).=20 I'm pretty sure there is a way to do what you want, and it's probably simpl= er=20 than you think.=20=20 However, I need you to be more explicit, with examples. I can't quite figu= re=20 out what is is you're trying to do. -Josh Berkus