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

From Chris Mair
Subject Re: rollback in C functions
Date
Msg-id 62e647e621dd500f172fa718abe0e0ee@smtp.hushmail.com
Whole thread Raw
In response to rollback in C functions  (Juan Pablo L <jpablolorenzetti@gmail.com>)
Responses Re: rollback in C functions
List pgsql-general
> The function is to execute updates on each ID assigning the value, but if
> one of these operation fails (does not meet certain criteria)
> inside the function i would like to rollback and leave everything
> untouched, in case other ID;s were already updated previously,
> and come back to the caller and infor

Hi,

I think you want ereport(), here is an example:
http://www.postgresql.org/docs/9.3/static/xfunc-c.html

Bye,
Chris.




pgsql-general by date:

Previous
From: Paul Jungwirth
Date:
Subject: Re: select where true, or select where input = '$var'
Next
From: Juan Pablo L
Date:
Subject: Re: rollback in C functions