Re: Plpgsql function with unknown number of args - Mailing list pgsql-general

From Tom Lane
Subject Re: Plpgsql function with unknown number of args
Date
Msg-id 26123.1113860525@sss.pgh.pa.us
Whole thread Raw
In response to Re: Plpgsql function with unknown number of args  ("Relyea, Mike" <Mike.Relyea@xerox.com>)
List pgsql-general
"Relyea, Mike" <Mike.Relyea@xerox.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

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: PostgreSQL as a filesystem
Next
From: Tom Lane
Date:
Subject: Re: pg_dump fails