Re: WIP patch: convert SQL-language functions to return tuplestores

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: WIP patch: convert SQL-language functions to return tuplestores
Дата
Msg-id 5036.1225469794@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: WIP patch: convert SQL-language functions to return tuplestores  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: WIP patch: convert SQL-language functions to return tuplestores  (Dimitri Fontaine <dfontaine@hi-media.com>)
Список pgsql-hackers
With the attached patch, SQL functions support returning the results of
INSERT/UPDATE/DELETE RETURNING clauses.  An INSERT/UPDATE/DELETE
statement is always executed to completion before returning (including
firing any related triggers or rules), so we always materialize the
RETURNING output.  When the function result comes from a SELECT, we
continue to use value-per-call mode when being called from
ExecMakeFunctionResult (thus preserving the prior behavior if the
calling query doesn't execute to completion).  When called from
ExecMakeTableFunctionResult, we materialize the output and return the
tuplestore in one call.  This is also the same behavior as before,
since ExecMakeTableFunctionResult would've filled a tuplestore anyway;
but it's noticeably faster because a lot of call/return and executor
entry overhead is eliminated.

This is code-complete but I haven't touched the docs yet.  Barring
objections, I plan to commit when I've finished fixing the docs.

            regards, tom lane


Вложения

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

Предыдущее
От: David Fetter
Дата:
Сообщение: Re: Window Functions: patch for CommitFest:Nov.
Следующее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: Enabling archive_mode without restart