Re: rollback to savepoint issue

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: rollback to savepoint issue
Дата
Msg-id 1157046.1693839486@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: rollback to savepoint issue  (Dominique Devienne <ddevienne@gmail.com>)
Список pgsql-general
Dominique Devienne <ddevienne@gmail.com> writes:
> Hi Erik. And experts at large. What's the underlying mechanism though? An
> implicit SAVEPOINT?

Yes, savepoints and plpgsql exception blocks are built on the same
"subtransaction" infrastructure.

> Which means extra explicit round-trips to the server to establish and "move
> along" the savepoint,
> per command. Which I think is "expensive". So would anonymous DO blocks be
> a better solution?

In general, moving logic to the server side is an effective way of
removing network round trips.  That could be DO blocks, functions,
or procedures.  If you're going to execute the same code over and
over within a session, a function or procedure will probably be
a better choice than re-issuing identical DO blocks.

            regards, tom lane



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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: rollback to savepoint issue
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: rollback to savepoint issue