From: Joe Conway <mail@joeconway.com>
To: Rich Cullingford <rculling@sysd.com>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: Tantalizing reference to passing data from NEW variable
Date: Mon, 26 Apr 2004 10:05:07 -0700
Message-ID: <408D4143.7040600@joeconway.com> (raw)
In-Reply-To: <408D2CE5.1090108@sysd.com>
References: <408D2CE5.1090108@sysd.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: mail@joeconway.com, rculling@sysd.com
Subject: Re: Tantalizing reference to passing data from NEW variable
In-Reply-To: <408D4143.7040600@joeconway.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox