Re: function SETOF return type with variable columns?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Merlin Moncure" <mmoncure(at)gmail(dot)com>
Cc: "James Neff" <james(dot)neff(at)tethyshealth(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: function SETOF return type with variable columns?
Date: 2008-08-21 02:08:34
Message-ID: 11298.1219284514@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Merlin Moncure" <mmoncure(at)gmail(dot)com> writes:
> PostgreSQL functions are for the most part strictly bound to their
> return type.

There is, however, the trick of declaring the function as "returns
record" and then specifying the names and types of the output columns
in the calling query. I'm not sure how practical that is to use with
a plpgsql function, and in any case it's not the syntax the OP asked
for; but it seems worth mentioning in this thread.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bill 2008-08-21 02:24:28 Re: ADO/ODBC returns TEXT fields as Varchar, not LongVarChar
Previous Message Merlin Moncure 2008-08-21 02:00:52 Re: function SETOF return type with variable columns?