Re: revised patch for PL/PgSQL table functions

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: revised patch for PL/PgSQL table functions
Дата
Msg-id 15599.1030801753@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: revised patch for PL/PgSQL table functions  (Neil Conway <neilc@samurai.com>)
Ответы Re: revised patch for PL/PgSQL table functions  (Neil Conway <neilc@samurai.com>)
Список pgsql-patches
Neil Conway <neilc@samurai.com> writes:
> Given that it's about 4AM here and I just took a 30-sec look at Tom's
> changes to the SRF code, forgive me if this is incorrect: I would
> think that the PL/PgSQL func would examine ReturnSetInfo.expectedDesc
> when processing a SETOF RECORD function, and use that to confirm that
> the RECORD has the appropriate TupleDesc, right?

Actually, it does that already: exec_stmt_return_next relies on the
expectedDesc to check the value being output in all cases.  So for a
SETOF RECORD function, the additional work required might be as simple
as just opening up the check in plpgsql_compile to allow RECORD return
type.  For the non-SETOF case (table function returning a single tuple),
I think exec_stmt_return would work okay as long as plpgsql_compile had
set fn_retistuple true for RECORD.

But I haven't tested it, and there might be other places in plpgsql that
examine the declared return type and would need tweaking.  I have other
fish to fry before beta, so no time...

            regards, tom lane

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

Предыдущее
От: Neil Conway
Дата:
Сообщение: Re: revised patch for PL/PgSQL table functions
Следующее
От: Gavin Sherry
Дата:
Сообщение: Re: [HACKERS] Proposed GUC Variable