Re: rollback in C functions

Поиск
Список
Период
Сортировка
От Juan Pablo L
Тема Re: rollback in C functions
Дата
Msg-id CABSYDabOMzOse4QXZLMtOsSequgBNxPOJVOcYpTXWukdHdu1Yg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: rollback in C functions  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Ответы Re: rollback in C functions  (John R Pierce <pierce@hogranch.com>)
Список pgsql-general
Thank you Alvaro, i m afraid ereport seems to be the way, that it is complicated to catch this error code in the code of the caller. cause you have to use a callback etc etc

On 19 February 2015 at 15:57, Alvaro Herrera <alvherre@2ndquadrant.com> wrote:
Juan Pablo L wrote:
> Hi, i want previous updates to rollback ... like nothing happened (a normal
> begin/rollback behaviour)

Ah, so ereport() is exactly what you want, like Chris Mair said.
Assuming you wrote it correctly, you should see the ERROR line in the
server logs (set log_message_verbosity=verbose in postgresql.conf to see
the full details such as the sqlstate etc).  Did you notice you must add
an extra ( before errmsg and other sub-calls within the ereport call?

--
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

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

Предыдущее
От: John R Pierce
Дата:
Сообщение: Re: rollback in C functions
Следующее
От: John R Pierce
Дата:
Сообщение: Re: rollback in C functions