Re: Plpgsql function with unknown number of args

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Relyea, Mike" <Mike(dot)Relyea(at)xerox(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Plpgsql function with unknown number of args
Date: 2005-04-18 21:42:05
Message-ID: 26123.1113860525@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Relyea, Mike" <Mike(dot)Relyea(at)xerox(dot)com> writes:
> Thanks for the input. This looks very promising. I have one further
> question. My SQL statement is going to pull data from more than one
> table in a relatively complex query. How do I cast the RETURNS portion
> of the function?

In current releases, you'll have to create a named composite type that
matches what you want to return, and declare the function as returning
that type.

(PG 8.1 will have a facility for named OUT parameters that lets you
avoid the notational overhead of inventing a composite type, although
what happens under-the-hood is not really very different.)

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2005-04-18 21:46:05 Re: pg_dump fails
Previous Message Andy Kopciuch 2005-04-18 21:29:26 Re: tsearch2