Re: rollback to savepoint issue

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: rollback to savepoint issue
Дата
Msg-id CAKFQuwb9yik6ocVi2_uVb1k_K0gtEKV07EFtoG0e9Rs77rdhCw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: rollback to savepoint issue  (Erik Wienhold <ewie@ewie.name>)
Список pgsql-general
On Monday, September 4, 2023, Erik Wienhold <ewie@ewie.name> wrote:
On 04/09/2023 11:51 CEST Lorusso Domenico <domenico.l76@gmail.com> wrote:

> I can't use the savepoint and rollback to savepoint clause.
> I've found some similar problems around on the web, but I can't catch the
> good way to proceed.
>
> What I'm trying to do is:
>   * compare new set of attribute with older
>   * if some attributes are part of old set and not in the new one: delete
>     the old
>   * but if parameter "on_misisng_delete" is false rollback delete command
>     and rais exception
> The original code in embedded in a function, but the problem is the same:

Transaction control is not possible in functions.  Only in procedures (CALL)
and DO blocks.

Then explain why the original savepoint command wasn’t a syntax, or runtime, error?  Plus, the error is syntax, usually when you try something that exists but is disallowed the system gives you some kind of invalid state exception at runtime,

David J.

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

Предыдущее
От: Dominique Devienne
Дата:
Сообщение: Re: rollback to savepoint issue
Следующее
От: Tom Lane
Дата:
Сообщение: Re: rollback to savepoint issue