rollback in function - Mailing list pgsql-general

From Juan Pablo L.
Subject rollback in function
Date
Msg-id DUB130-W51AD18DB90DD08ADC29A41D92D0@phx.gbl
Whole thread Raw
Responses Re: rollback in function  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-general
Hello, i have created a function (in C) that receives an array that contains tuples of ID's and values.

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 inform about it.

I have read all over that it is not posible to do rollback inside a function because each function is executed inside a transaction
so inside the function you dont have control over BEGIN/ROLLBACK, but i m sure there is a way to do this, can anyone please give me a hint
how this is accomplished ? thank you!!!

pgsql-general by date:

Previous
From: Shanker Singh
Date:
Subject: Re: parallel dump fails to dump large tables
Next
From: Pavel Stehule
Date:
Subject: Re: rollback in function