Re: returning SETOF RECORD

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: returning SETOF RECORD
Дата
Msg-id 12560.1405460131@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: returning SETOF RECORD  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: returning SETOF RECORD  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Tue, Jul 15, 2014 at 10:20 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> I think you're confusing these functions with the kind that specify
>> their own output rowtype --- which we *can* handle, via a list of OUT
>> parameters.  In these cases, the entire point is that the user has to
>> specify what SQL rowtype he wants out of the conversion.

> Actually, on further study, I found that isn't quite true.  dblink()'s
> materializeResult() calls CreateTemplateTupleDesc() if the query
> returns PGRES_COMMAND_OK and get_call_result_type() only if it returns
> PGRES_TUPLES_OK.

Right --- in the command case, dblink acts like a function that does know
its output rowtype.  None too consistent.

We could imagine allowing dblink to default to an output rowtype of
"(text,text,...)" if it can't get anything from its call environment.
I'm not sure if that would be an improvement or not.
        regards, tom lane



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [COMMITTERS] pgsql: Reset master xmin when hot_standby_feedback disabled.
Следующее
От: Tom Lane
Дата:
Сообщение: Upcoming back-branch releases