pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Milen A. Radev <milen@radev.net>
To: pgsql-sql@postgresql.org
Subject: Re: Triggers using PL/pgSQL
Date: Mon, 31 Jul 2006 19:12:30 +0300
Message-ID: <44CE2BEE.2070201@radev.net> (raw)
In-Reply-To: <20060731041644.32247.qmail@web56610.mail.re3.yahoo.com>
References: <20060731041644.32247.qmail@web56610.mail.re3.yahoo.com>

Thusitha Kodikara написа:
> Hello,
> 
> I am interested in developing some triggers to keep track of records that are changed (possibly the changes of one or more specific columns). In addition to keeping the new values, I also need to keep the old values (may be on a separate table).  
> 
> Though I  have done similar things in other RDBMs using SQL, I find doing this in Postgres, a little bit complicated - may be because it needs to be done through a separate procedural language and through a separate function. The Postgres documentation also didn't provide much help ( the examples in C). I was mainly looking for example showing how to refer 'OLD' and 'NEW' rows using PL/pgSQL.
> 
> Can someone please direct me to some such examples?


http://www.postgresql.org/docs/8.1/static/plpgsql-trigger.html


-- 
Milen A. Radev




view thread (10+ messages)  latest in thread

Message-ID: <44CE2BEE.2070201@radev.net>
Permalink:  ../44CE2BEE.2070201@radev.net/
Also on:    postgresql.org/message-id/44CE2BEE.2070201@radev.net

 · 

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: milen@radev.net
  Subject: Re: Triggers using PL/pgSQL
  In-Reply-To: <44CE2BEE.2070201@radev.net>

* 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