Re: SPI function to investigate query semantics

Поиск
Список
Период
Сортировка
От Thomas Hallgren
Тема Re: SPI function to investigate query semantics
Дата
Msg-id 41AE3E49.3040601@mailblocks.com
обсуждение исходный текст
Ответ на SPI function to investigate query semantics  (Thomas Hallgren <thhal@mailblocks.com>)
Ответы Re: SPI function to investigate query semantics  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-patches
Tom Lane wrote:

>We haven't got one that will work from inside arbitrary functions ---
>DefineSavepoint and friends don't get it done by themselves, but
>expect you to call CommitTransactionCommand/StartTransactionCommand,
>and those functions tend to pull the rug out from under the executor.
>(I seem to recall trying to do it that way in the first attempt on
>plpgsql, and running into all kinds of memory management issues.)
>
>The existing PLs use BeginInternalSubTransaction,
>ReleaseCurrentSubTransaction, RollbackAndReleaseCurrentSubTransaction,
>but these are subset implementations only suited for
>exception-block-structured code.
>
>
Thanks. I'll check that out and try to figure out how to use it.

What are the future plans? For me it would work really well with
something like

Savepoint SPI_savepoint(const char* name);
void SPI_releaseSavepoint(Savepoint sp);
void SPI_rollbackSavepoint(Savepoint sp);

The Savepoint structure could then hold information about call level
etc. needed to ensure proper behaviour when nesting.

Regards,
Thomas Hallgren


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

Предыдущее
От: Thomas Hallgren
Дата:
Сообщение: SPI function to investigate query semantics
Следующее
От: Tom Lane
Дата:
Сообщение: Re: SPI function to investigate query semantics