Re: returning SETOF RECORD

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: returning SETOF RECORD
Дата
Msg-id CA+Tgmoa2UTmXf5RGBehQSiiSS=4xHtDh2=2kikBZxJdovLcwgg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: returning SETOF RECORD  (Andrew Dunstan <andrew@dunslane.net>)
Ответы Re: returning SETOF RECORD  (Andrew Dunstan <andrew@dunslane.net>)
Re: returning SETOF RECORD  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Mon, Jul 14, 2014 at 4:39 PM, Andrew Dunstan <andrew@dunslane.net> wrote:
>> Is there any reasonable alternative?  That is, if you have a function
>> returning SETOF record, and the details of the record type aren't
>> specified, is there anything you can do other than error out like
>> this?
>
> Not that I can see. What would you suggest?

Dunno.  Was hoping someone else had an idea.  It'd certainly be nice
to have some way of calling functions like this without specifying the
shape of the return value, but I doubt there's a way to make that work
without a lot of new infrastructure.  For example, if a function could
be called at the point where we need to know the record shape with a
special flag that says "just tell me what kind of record you're going
to return" and then called again at execution time to actually produce
the results, that would be nifty.

But mostly, I think it's slightly odd that the function gets called at
all if nothing useful can be done.  Why not just error out in the
caller?  So that made me wonder if maybe there is a way to do
something useful, and I'm just not seeing it.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: returning SETOF RECORD
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: pg_shmem_allocations view