X-Original-To: pgsql-novice-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 9864A8B9EE0; Thu, 3 Feb 2005 08:01:58 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 07007-08; Thu, 3 Feb 2005 08:01:53 +0000 (GMT) Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by svr1.postgresql.org (Postfix) with ESMTP id BDAF68B9E02; Thu, 3 Feb 2005 08:01:54 +0000 (GMT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.1/8.13.1) with ESMTP id j1381hbU010669 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 3 Feb 2005 01:01:45 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.1/8.13.1) with ESMTP id j1381hec047470; Thu, 3 Feb 2005 01:01:43 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.1/8.13.1/Submit) id j1381gWi047469; Thu, 3 Feb 2005 01:01:42 -0700 (MST) (envelope-from mfuhr) Date: Thu, 3 Feb 2005 01:01:42 -0700 From: Michael Fuhr To: Hasnul Fadhly bin Hasan Cc: pgsql-performance@postgresql.org, pgsql-novice@postgresql.org Subject: Re: [PERFORM] Accessing insert values in triggers Message-ID: <20050203080142.GA47411@winnie.fuhr.org> References: <4200A534.3030405@mimos.my> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4200A534.3030405@mimos.my> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.003 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200502/54 X-Sequence-Number: 12293 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/