Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 93902476381 for ; Thu, 16 May 2002 13:42:04 -0400 (EDT) Received: from ler-freebie.iadfw.net (ler-freebie.iadfw.net [206.66.13.221]) by postgresql.org (Postfix) with ESMTP id 3A72147647E for ; Thu, 16 May 2002 13:38:17 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by ler-freebie.iadfw.net (8.12.2/8.12.2) with ESMTP id g4GHcDv2016958 for ; Thu, 16 May 2002 12:38:14 -0500 (CDT) (envelope-from ler@lerctr.org) Subject: trigger question From: Larry Rosenman To: pgsql-sql@postgresql.org Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Ximian Evolution 1.0.5 Date: 16 May 2002 12:38:13 -0500 Message-Id: <1021570694.95676.7.camel@ler-freebie.iadfw.net> Mime-Version: 1.0 X-Archive-Number: 200205/163 X-Sequence-Number: 7799 Is there a way in PL/pgSQL to have a trigger look at the fields in a %ROWTYPE variable to look for changes? 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. Am I just SOL, or is there a way to do this? (7.2.1, if it matters). Thanks, LER -- Larry Rosenman http://www.lerctr.org/~ler Phone: +1 972-414-9812 E-Mail: ler@lerctr.org US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749