Re: stored procedure: RETURNS record

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Rob Marjot <rob(at)marjot-multisoft(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: stored procedure: RETURNS record
Date: 2009-09-25 22:31:24
Message-ID: 10079.1253917884@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Rob Marjot <rob(at)marjot-multisoft(dot)com> writes:
> Any thoughts on how to make sure multiple columns are returned; without
> specifying this in the function's prototype return clause?

If you want "SELECT * FROM" to expand to multiple columns, the names
and types of those columns *must* be available at parse time. You
can either declare them in the function prototype, or you can supply
them in the function call, a la

select * from my_func(...) as x(a int, b int);

It will not work to hope that the parser can predict what the function
will do when executed.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2009-09-25 22:38:35 Re: pg_restore ordering questions
Previous Message Steve Crawford 2009-09-25 22:15:29 pg_restore ordering questions