Re: [PERFORM] Accessing insert values in triggers

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Hasnul Fadhly bin Hasan <hasnulfadhly(dot)h(at)mimos(dot)my>
Cc: pgsql-performance(at)postgresql(dot)org, pgsql-novice(at)postgresql(dot)org
Subject: Re: [PERFORM] Accessing insert values in triggers
Date: 2005-02-03 08:01:42
Message-ID: 20050203080142.GA47411@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice pgsql-performance

On Wed, Feb 02, 2005 at 06:02:28PM +0800, Hasnul Fadhly bin Hasan wrote:

> When new data is inserted, we have to use new.xxxx to access the data.
> Is there another way to access the data that would be more generic
> like value[1] and so on? This way, the tracker is independant of any
> tables.

Procedural languages like PL/Perl, PL/Tcl, and PL/Python can access
NEW and OLD columns without knowing the column names in advance.

http://www.postgresql.org/docs/8.0/static/plperl-triggers.html
http://www.postgresql.org/docs/8.0/static/pltcl-trigger.html
http://www.postgresql.org/docs/8.0/static/plpython-trigger.html

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Gavin Henry 2005-02-03 09:52:35 Scripting a pg_dumpall/pg_dump backup using bash or perl
Previous Message Tom Lane 2005-02-03 06:42:31 Re: DB Error: connect failed

Browse pgsql-performance by date

  From Date Subject
Next Message Christopher Kings-Lynne 2005-02-03 09:28:52 Re: GiST indexes and concurrency (tsearch2)
Previous Message Tom Lane 2005-02-03 06:55:28 Re: horizontal partition