Re: stored procedure: RETURNS record - Mailing list pgsql-general

From Tom Lane
Subject Re: stored procedure: RETURNS record
Date
Msg-id 10079.1253917884@sss.pgh.pa.us
Whole thread Raw
In response to Re: stored procedure: RETURNS record  (Rob Marjot <rob@marjot-multisoft.com>)
List pgsql-general
Rob Marjot <rob@marjot-multisoft.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

pgsql-general by date:

Previous
From: Steve Crawford
Date:
Subject: pg_restore ordering questions
Next
From: Tom Lane
Date:
Subject: Re: pg_restore ordering questions