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

From Erik Wienhold
Subject Re: rollback to savepoint issue
Date
Msg-id 1165806895.176202.1693840943412@office.mailbox.org
Whole thread Raw
In response to rollback to savepoint issue  (Lorusso Domenico <domenico.l76@gmail.com>)
Responses Re: rollback to savepoint issue  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
List pgsql-general
On 04/09/2023 16:56 CEST David G. Johnston <david.g.johnston@gmail.com> wrote:

> On Monday, September 4, 2023, Erik Wienhold <ewie@ewie.name> wrote:
>
> > On 04/09/2023 11:51 CEST Lorusso Domenico <domenico.l76@gmail.com> wrote:
> >
> >  > The original code in embedded in a function, but the problem is the same:
> >
> >  Transaction control is not possible in functions. Only in procedures (CALL)
> >  and DO blocks.
>
> Then explain why the original savepoint command wasn’t a syntax, or runtime,
> error?

I don't need to because CREATE {FUNCTION | PROCEDURE} already fails because of
ROLLBACK TO SAVEPOINT.  And without a function to execute there can't be any
runtime error because of SAVEPOINT.  My point was about transaction control in
plpgsql in general.

> Plus, the error is syntax, usually when you try something that exists
> but is disallowed the system gives you some kind of invalid state exception
> at runtime,

--
Erik



pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: rollback to savepoint issue
Next
From: Lorusso Domenico
Date:
Subject: Array vs Temporary table vs Normal Table + truncate at end