Re: rollback to savepoint issue - Mailing list pgsql-general

From Dominique Devienne
Subject Re: rollback to savepoint issue
Date
Msg-id CAFCRh-_zL2oqjqu-rG-LZps1vTk9uOtWte3daQf7tPH=j2tJFw@mail.gmail.com
Whole thread Raw
In response to Re: rollback to savepoint issue  (Dominique Devienne <ddevienne@gmail.com>)
List pgsql-general
On Mon, Sep 4, 2023 at 4:22 PM Dominique Devienne <ddevienne@gmail.com> wrote:
On Mon, Sep 4, 2023 at 3:47 PM Erik Wienhold <ewie@ewie.name> wrote:
On 04/09/2023 11:51 CEST Lorusso Domenico <domenico.l76@gmail.com> wrote:
Transaction control is not possible in functions.  Only in procedures (CALL)
and DO blocks.

> ERROR: syntax error at or near "to"
> LINE 41: rollback to savepoint deleteAttribute;

Use BEGIN ... EXCEPTION ... END instead of manual savepoints. [1]

[1] https://www.postgresql.org/docs/current/plpgsql-porting.html#PLPGSQL-PORTING-EXCEPTIONS

Hi Erik. And experts at large. What's the underlying mechanism though? An implicit SAVEPOINT?
[...] Thanks for any insights. --DD

(I guess I should have done a little more research before posting...)

I think Laurenz' old post answers most of my question. I probably read it before too!

Different devs work on different parts of our (large) system / apps, and we don't all use
SAVEPOINTs. I don't, but one of my colleagues does. Thus my (hasty) questions above.
Sorry for the noise. --DD

pgsql-general by date:

Previous
From: Adam Lee
Date:
Subject: Re: [EXTERNAL] Oracle FDW version
Next
From: "David G. Johnston"
Date:
Subject: Re: rollback to savepoint issue