pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Josh Berkus <josh@agliodbs.com>
To: Larry Rosenman <ler@lerctr.org>
To: pgsql-sql@postgresql.org
Subject: Re: trigger question
Date: Thu, 16 May 2002 10:49:23 -0700
Message-ID: <200205161049.23148.josh@agliodbs.com> (raw)
In-Reply-To: <1021570694.95676.7.camel@ler-freebie.iadfw.net>
References: <1021570694.95676.7.camel@ler-freebie.iadfw.net>

Larry,

> 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). 

I'm pretty sure there is a way to do what you want, and it's probably simpler 
than you think.  

However, I need you to be more explicit, with examples.  I can't quite figure 
out what is is you're trying to do.

-Josh Berkus



view thread (14+ messages)  latest in thread

Message-ID: <200205161049.23148.josh@agliodbs.com>
Permalink:  ../200205161049.23148.josh@agliodbs.com/
Also on:    postgresql.org/message-id/200205161049.23148.josh@agliodbs.com

 · 

reply

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-sql@postgresql.org
  Cc: josh@agliodbs.com, ler@lerctr.org
  Subject: Re: trigger question
  In-Reply-To: <200205161049.23148.josh@agliodbs.com>

* 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