Triggers using PL/pgSQL

From: Thusitha Kodikara <kthusi(at)yahoo(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Triggers using PL/pgSQL
Date: 2006-07-31 04:16:44
Message-ID: 20060731041644.32247.qmail@web56610.mail.re3.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php pgsql-sql

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?

Thanks and regards,
-Thusitha

Responses

Browse pgsql-php by date

  From Date Subject
Next Message Aaron Bono 2006-07-31 04:52:41 Re: Triggers using PL/pgSQL
Previous Message Chris 2006-07-30 21:33:09 Re: How to upgrade Centos 4.3 to PHP 5.1 and Postgresql 8.1

Browse pgsql-sql by date

  From Date Subject
Next Message Aaron Bono 2006-07-31 04:52:41 Re: Triggers using PL/pgSQL
Previous Message Aaron Bono 2006-07-30 20:28:54 Re: primary keys as TEXT