Re: Passing RECORD variable from func1() to func2()

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Henry Combrinck" <henry(at)metroweb(dot)co(dot)za>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Passing RECORD variable from func1() to func2()
Date: 2004-09-06 18:32:20
Message-ID: 17788.1094495540@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Henry Combrinck" <henry(at)metroweb(dot)co(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Philippe Lang 2004-09-06 18:32:25 Re: RAD with postgreSQL
Previous Message Secrétariat 2004-09-06 18:09:39 PL-PGSQL language