11 beta 3 / ROLLBACK TO SAVEPOINT regression in PLPGSQL

Started by David Klikaover 7 years ago6 messagesbugs
Jump to latest
#1David Klika
david.klika@atlas.cz

This routine works well on postgres v10:

CREATE FUNCTION test_savepoint() RETURNS VOID AS $body$

BEGIN

SAVEPOINT my_savepoint;

ROLLBACK TO my_savepoint;

END $body$ LANGUAGE plpgsql;

The same code can not be compiled in postgres v11 beta 3, I got error:

[42601]: ERROR: syntax error at or near "TO"

Position: 117

Best regards

David Klika

In reply to: David Klika (#1)
Re: 11 beta 3 / ROLLBACK TO SAVEPOINT regression in PLPGSQL

Hello

This routine works well on postgres v10:

it works? Or is only accepted as input? I got error on function call.
I thought plpgsql cannot directly uses savepoints, only implicitly with begin ... exception ... end block ( https://www.postgresql.org/docs/current/static/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING )

Well, you can still create this function with set check_function_bodies to off

regards, Sergei

#3Pavel Stehule
pavel.stehule@gmail.com
In reply to: Sergei Kornilov (#2)
Re: 11 beta 3 / ROLLBACK TO SAVEPOINT regression in PLPGSQL

2018-08-23 14:41 GMT+02:00 Sergei Kornilov <sk@zsrv.org>:

Hello

This routine works well on postgres v10:

it works? Or is only accepted as input? I got error on function call.
I thought plpgsql cannot directly uses savepoints, only implicitly with
begin ... exception ... end block ( https://www.postgresql.org/
docs/current/static/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING
)

Well, you can still create this function with set check_function_bodies to
off

This doesn't help, because any function is validated before execution

Regards

Pavel

Show quoted text

regards, Sergei

#4Pavel Stehule
pavel.stehule@gmail.com
In reply to: Pavel Stehule (#3)
Re: 11 beta 3 / ROLLBACK TO SAVEPOINT regression in PLPGSQL

2018-08-23 15:00 GMT+02:00 Pavel Stehule <pavel.stehule@gmail.com>:

2018-08-23 14:41 GMT+02:00 Sergei Kornilov <sk@zsrv.org>:

Hello

This routine works well on postgres v10:

it works? Or is only accepted as input? I got error on function call.
I thought plpgsql cannot directly uses savepoints, only implicitly with
begin ... exception ... end block ( https://www.postgresql.org/doc
s/current/static/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING )

Well, you can still create this function with set check_function_bodies
to off

This doesn't help, because any function is validated before execution

but it is hard to believe, so it was working ever.

Show quoted text

Regards

Pavel

regards, Sergei

#5David Klika
david.klika@atlas.cz
In reply to: Pavel Stehule (#4)
RE: 11 beta 3 / ROLLBACK TO SAVEPOINT regression in PLPGSQL

This routine works well on postgres v10:

it works? Or is only accepted as input? I got error on function call.
I thought plpgsql cannot directly uses savepoints, only implicitly with begin ... exception ... end block ( https://www.postgresql.org/docs/current/static/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING )

Well, you can still create this function with set check_function_bodies to off

This doesn't help, because any function is validated before execution

but it is hard to believe, so it was working ever.

You are right, calling the method lead to error in both cases. My misunderstanding, sorry. David

#6Pavel Stehule
pavel.stehule@gmail.com
In reply to: David Klika (#5)
Re: 11 beta 3 / ROLLBACK TO SAVEPOINT regression in PLPGSQL

2018-08-23 16:45 GMT+02:00 David Klika <david.klika@atlas.cz>:

This routine works well on postgres v10:

it works? Or is only accepted as input? I got error on function call.
I thought plpgsql cannot directly uses savepoints, only implicitly with
begin ... exception ... end block ( https://www.postgresql.org/
docs/current/static/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING
)

Well, you can still create this function with set check_function_bodies to
off

This doesn't help, because any function is validated before execution

but it is hard to believe, so it was working ever.

You are right, calling the method lead to error in both cases. My
misunderstanding, sorry. David

No problem :)

Pavel