Hi Thanks Chris, yes i have already tested ereport and even made up my own
sql state to report and error but from the application i can not access
this error code directly (through the PQexec,PQresultErrorField,etc
functions because the PGresult returns NULL) but i have to register a
callback function that will be called with this error code with the idea to
format the error message so i could intercept this and do something, but
this does not allow me to have direct access to the flow where this is all
happening .. i hope it is clear ...

On 19 February 2015 at 15:02, Chris Mair <ch...@1006.org> wrote:

> > 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.
>
>
>

Reply via email to