Re: rollback to savepoint issue

2023-09-05 Thread Tom Lane
Alvaro Herrera writes: > But it gets worse. If you create a procedure (no longer a function) > with a SAVEPOINT and ROLLBACK TO SAVEPOINT, it'll complain about the > ROLLBACK TO command, but not about SAVEPOINT; and if you remove that, > then it'll fail at runtime saying that SAVEPOINT is unsuppo

Re: rollback to savepoint issue

2023-09-05 Thread Alvaro Herrera
On 2023-Sep-04, Erik Wienhold wrote: > On 04/09/2023 16:56 CEST David G. Johnston wrote: > > > On Monday, September 4, 2023, Erik Wienhold wrote: > > > > > On 04/09/2023 11:51 CEST Lorusso Domenico wrote: > > > > > > > The original code in embedded in a function, but the problem is the > > >

Re: rollback to savepoint issue

2023-09-04 Thread David G. Johnston
On Monday, September 4, 2023, Erik Wienhold wrote: > On 04/09/2023 11:51 CEST Lorusso Domenico wrote: > > > I can't use the savepoint and rollback to savepoint clause. > > I've found some similar problems around on the web, but I can't catch the > > good way to proceed. > > > > What I'm trying t

Re: rollback to savepoint issue

2023-09-04 Thread Dominique Devienne
On Mon, Sep 4, 2023 at 4:22 PM Dominique Devienne wrote: > On Mon, Sep 4, 2023 at 3:47 PM Erik Wienhold wrote: > >> On 04/09/2023 11:51 CEST Lorusso Domenico wrote: >> Transaction control is not possible in functions. Only in procedures >> (CALL) >> and DO blocks. >> >> > ERROR: syntax error a

Re: rollback to savepoint issue

2023-09-04 Thread Erik Wienhold
On 04/09/2023 16:56 CEST David G. Johnston wrote: > On Monday, September 4, 2023, Erik Wienhold wrote: > > > On 04/09/2023 11:51 CEST Lorusso Domenico wrote: > > > > > The original code in embedded in a function, but the problem is the same: > > > > Transaction control is not possible in func

Re: rollback to savepoint issue

2023-09-04 Thread Adrian Klaver
On 9/4/23 07:56, David G. Johnston wrote: On Monday, September 4, 2023, Erik Wienhold > wrote: On 04/09/2023 11:51 CEST Lorusso Domenico mailto:domenico@gmail.com>> wrote: > I can't use the savepoint and rollback to savepoint clause. > I've found some si

Re: rollback to savepoint issue

2023-09-04 Thread Tom Lane
Dominique Devienne writes: > Hi Erik. And experts at large. What's the underlying mechanism though? An > implicit SAVEPOINT? Yes, savepoints and plpgsql exception blocks are built on the same "subtransaction" infrastructure. > Which means extra explicit round-trips to the server to establish and

Re: rollback to savepoint issue

2023-09-04 Thread Dominique Devienne
On Mon, Sep 4, 2023 at 3:47 PM Erik Wienhold wrote: > On 04/09/2023 11:51 CEST Lorusso Domenico 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; >

Re: rollback to savepoint issue

2023-09-04 Thread Erik Wienhold
On 04/09/2023 11:51 CEST Lorusso Domenico wrote: > I can't use the savepoint and rollback to savepoint clause. > I've found some similar problems around on the web, but I can't catch the > good way to proceed. > > What I'm trying to do is: > * compare new set of attribute with older > * if so