X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 425ABD1BAE9 for ; Mon, 26 Apr 2004 14:17:56 -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 39955-05 for ; Mon, 26 Apr 2004 14:17:49 -0300 (ADT) Received: from joeconway.com (66-146-172-86.skyriver.net [66.146.172.86]) by svr1.postgresql.org (Postfix) with ESMTP id 95797D1CE3E for ; Mon, 26 Apr 2004 14:17:27 -0300 (ADT) Received: from [206.19.64.3] (account jconway HELO joeconway.com) by joeconway.com (CommuniGate Pro SMTP 4.1.8) with ESMTP-TLS id 1570662; Mon, 26 Apr 2004 10:00:33 -0700 Message-ID: <408D4143.7040600@joeconway.com> Date: Mon, 26 Apr 2004 10:05:07 -0700 From: Joe Conway User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Rich Cullingford Cc: pgsql-interfaces@postgresql.org Subject: Re: Tantalizing reference to passing data from NEW variable References: <408D2CE5.1090108@sysd.com> In-Reply-To: <408D2CE5.1090108@sysd.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200404/63 X-Sequence-Number: 4884 Rich Cullingford wrote: > This question seems to have been asked a number of times on this list, > recently (including by me) without being answered: how to pass the row > data stored in the NEW variable from a trigger function into a > sub-function. None of the obvious syntaxes work, including one by a > respondent in this list that suggested assigning NEW to a record > variable, and then passing *that*. After searching up and down the > archives, I see the following tantalizing snippet (from 6/2003) in the > context of a rule: The standard answer to this has been to use PL/Tcl for your trigger function instead of PL/pgSQL. I imagine PL/Python would work also, but I'm not sure. (FWIW, PL/R would work too, but I doubt you would want to install R just to have this capability.) I looked a bit at making this work in PL/pgSQL at some point -- IIRC the issues to be solved were non-trivial. Joe