Re: Question on how to conditionally commit or rollback a sql-request

Поиск
Список
Период
Сортировка
От Daniel Verite
Тема Re: Question on how to conditionally commit or rollback a sql-request
Дата
Msg-id 1aa503f7-6b03-4785-96fa-f6d16933e4ff@mm
обсуждение исходный текст
Ответ на Question on how to conditionally commit or rollback a sql-request  ("Bergbom Staffan" <Staffan.Bergbom@lm.se>)
Список pgsql-general
    Bergbom Staffan wrote:

> I get the following error:
> ERROR: SPI execute_plan failed executing query “Commit”:
> SPI_ERROR_TRANSACTION
> CONTEXT: Pl/pgSQL function “objectdescription_bu” line 9 at SQL statement
>
> What does this mean and what should I do to be able to do the desired check

It's not possible to commit or rollback inside a function.
Instead of issuing a rollback, you could raise an exception, and instead of
doing a commit, you should do nothing at all.

Best regards,
--
Daniel
PostgreSQL-powered mail user agent and storage: http://www.manitou-mail.org

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

Предыдущее
От: Matthias Dietrich
Дата:
Сообщение: Upgraded from Leopard to Snow Leopard - PostgreSQL won't start anymore
Следующее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: Save MySQL? HA