Re: rollback in C functions

From: Chris Mair <chris(at)1006(dot)org>
To: PostgreSQL mailing lists <pgsql-general(at)postgresql(dot)org>
Cc: Juan Pablo L <jpablolorenzetti(at)gmail(dot)com>
Subject: Re: rollback in C functions
Date: 2015-02-19 21:02:38
Message-ID: 62e647e621dd500f172fa718abe0e0ee@smtp.hushmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Juan Pablo L 2015-02-19 21:14:06 Re: rollback in C functions
Previous Message Paul Jungwirth 2015-02-19 20:51:54 Re: select where true, or select where input = '$var'