Re: rollback in C functions - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: rollback in C functions
Date
Msg-id 20150219215723.GM2500@alvh.no-ip.org
Whole thread Raw
In response to Re: rollback in C functions  (Juan Pablo L <jpablolorenzetti@gmail.com>)
Responses Re: rollback in C functions  (Juan Pablo L <jpablolorenzetti@gmail.com>)
List pgsql-general
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 by date:

Previous
From: Juan Pablo L
Date:
Subject: Re: rollback in C functions
Next
From: John R Pierce
Date:
Subject: Re: rollback in C functions