Re: Passing RECORD variable from func1() to func2() - Mailing list pgsql-general

From Tom Lane
Subject Re: Passing RECORD variable from func1() to func2()
Date
Msg-id 17788.1094495540@sss.pgh.pa.us
Whole thread Raw
In response to Passing RECORD variable from func1() to func2()  ("Henry Combrinck" <henry@metroweb.co.za>)
Responses Re: Passing RECORD variable from func1() to func2()  ("Henry Combrinck" <henry@metroweb.co.za>)
List pgsql-general
"Henry Combrinck" <henry@metroweb.co.za> writes:
> Essentially, I would like to pass a RECORD variable from one function to
> another using plpgsql:

> func2(record)

You can't declare a plpgsql function that accepts RECORD; this is simply
not supportable.  (For one thing, which actual record types should such
a function be considered to match?  It's a nonstarter even at the level
of function argument resolution, let alone the implementation issues.)
It has to take some named rowtype, instead.

There are implementation restrictions in 7.4 and before that prevent
plpgsql functions from passing row or record variables to other
functions, so you'd have problems at the calling end as well.
FWIW these restrictions are fixed for 8.0.

            regards, tom lane

pgsql-general by date:

Previous
From: "Philippe Lang"
Date:
Subject: Re: RAD with postgreSQL
Next
From: Alvaro Herrera
Date:
Subject: Re: PL-PGSQL language