Skip site navigation (1) Skip section navigation (2)

Re: Tantalizing reference to passing data from NEW variable

From: Joe Conway <mail(at)joeconway(dot)com>
To: Rich Cullingford <rculling(at)sysd(dot)com>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: Tantalizing reference to passing data from NEW variable
Date: 2004-04-26 17:05:07
Message-ID: 408D4143.7040600@joeconway.com (view raw or flat)
Thread:
Lists: pgsql-interfaces
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


In response to

Responses

pgsql-interfaces by date

Next:From: Kevin CowleyDate: 2004-04-27 12:51:56
Subject: Application compile file using Embeded SQL in Postgres4.7.2
Previous:From: Rich CullingfordDate: 2004-04-26 15:38:13
Subject: Tantalizing reference to passing data from NEW variable in a trigger function...

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group