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

Re: passing new/old record in pl/pgsql trigger functions to other functions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: basic <basic(at)mozdev(dot)org>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: passing new/old record in pl/pgsql trigger functions to other functions
Date: 2004-05-31 06:14:56
Message-ID: 13912.1085984096@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-sql
basic <basic(at)mozdev(dot)org> writes:
>    In Postgresql version 7.4.1 How does one pass new/old record in a 
> pl/pgsql trigger function to other functions?

You can't ... NEW and OLD are of unspecified-record types, and there's
no support for passing such things to other functions.  You pretty much
have to do the tedious "myfunc(NEW.f1, NEW.f2, ...)".

I've done some work recently to improve the support for passing record
types around as full-fledged datatypes.  The above still doesn't quite
work, and I can't promise that it'll get done for 7.5, but hopefully by
the release after that it will.

			regards, tom lane

In response to

pgsql-sql by date

Next:From: sadDate: 2004-05-31 07:52:42
Subject: type regclass casting
Previous:From: basicDate: 2004-05-31 05:51:33
Subject: passing new/old record in pl/pgsql trigger functions to other functions

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