X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 9558ED1B229 for ; Mon, 31 May 2004 02:51:47 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 60412-01 for ; Mon, 31 May 2004 02:51:46 -0300 (ADT) Received: from neptune.lunarpages.com (neptune.lunarpages.com [216.193.194.11]) by svr1.postgresql.org (Postfix) with ESMTP id 55BD1D1B21B for ; Mon, 31 May 2004 02:51:44 -0300 (ADT) Received: from [219.95.191.226] (helo=[10.1.1.2]) by neptune.lunarpages.com with esmtp (TLSv1:AES256-SHA:256) (Exim 4.34) id 1BUfiE-0006CK-S5 for pgsql-sql@postgresql.org; Sun, 30 May 2004 22:51:55 -0700 Message-ID: <40BAC7E5.4020509@mozdev.org> Date: Mon, 31 May 2004 13:51:33 +0800 From: basic User-Agent: Mozilla Thunderbird 0.6+ (X11/20040510) X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: passing new/old record in pl/pgsql trigger functions to other functions Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - neptune.lunarpages.com X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - mozdev.org X-Source: X-Source-Args: X-Source-Dir: X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.1 tagged_above=0.0 required=5.0 tests=RCVD_IN_RFCI X-Spam-Level: X-Archive-Number: 200405/221 X-Sequence-Number: 17935 Hi, In Postgresql version 7.4.1 How does one pass new/old record in a pl/pgsql trigger function to other functions? I tried to pass it directly but the select/perform statement caused an error saying "NEW used in query that is not in a rule". I've tried 'rename' in the declare block but that didn't work at all (I get 'invalid column', which I assume it means rename did not work at all). Besides copying the record columns one by one, is there any other way to do this? -- basic