Skip site navigation (1) Skip section navigation (2)

Re: trigger question

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: Larry Rosenman <ler(at)lerctr(dot)org>, pgsql-sql(at)postgresql(dot)org
Subject: Re: trigger question
Date: 2002-05-16 17:49:23
Message-ID: 200205161049.23148.josh@agliodbs.com (view raw or flat)
Thread:
Lists: pgsql-sql
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

In response to

Responses

pgsql-sql by date

Next:From: Larry RosenmanDate: 2002-05-16 17:51:03
Subject: Re: trigger question
Previous:From: Larry RosenmanDate: 2002-05-16 17:38:13
Subject: trigger question

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group