diff options
author | Peter Eisentraut <peter@eisentraut.org> | 2021-06-17 16:37:13 +0200 |
---|---|---|
committer | Peter Eisentraut <peter@eisentraut.org> | 2021-06-17 16:39:13 +0200 |
commit | 70293e946e60bb7eb58f74656667458406a1b461 (patch) | |
tree | 5d0cec19795e987cb25ff05ef12121707137e3ae /src | |
parent | 6765cbd22a6bf1d11f4293fe7daed7512fb54ecf (diff) | |
download | postgresql-70293e946e60bb7eb58f74656667458406a1b461.tar.gz postgresql-70293e946e60bb7eb58f74656667458406a1b461.zip |
Update plpython_subtransaction alternative expected files
The original patch only targeted Python 2.6 and newer, since that is
what we have supported in PostgreSQL 13 and newer. For older
branches, we need to fix it up for older Python versions.
Diffstat (limited to 'src')
4 files changed, 14 insertions, 8 deletions
diff --git a/src/pl/plpython/expected/plpython_subtransaction.out b/src/pl/plpython/expected/plpython_subtransaction.out index d36aac127bb..d578c099d03 100644 --- a/src/pl/plpython/expected/plpython_subtransaction.out +++ b/src/pl/plpython/expected/plpython_subtransaction.out @@ -239,7 +239,7 @@ AS $$ try: with plpy.subtransaction() as s: s.__exit__(None, None, None) -except ValueError as e: +except ValueError, e: raise ValueError(e) $$ LANGUAGE plpythonu; SELECT subtransaction_exit_without_enter(); diff --git a/src/pl/plpython/expected/plpython_subtransaction_0.out b/src/pl/plpython/expected/plpython_subtransaction_0.out index 97ee42b5a9a..45b57c2e77f 100644 --- a/src/pl/plpython/expected/plpython_subtransaction_0.out +++ b/src/pl/plpython/expected/plpython_subtransaction_0.out @@ -222,11 +222,14 @@ ERROR: could not compile PL/Python function "subtransaction_enter_subtransactio DETAIL: SyntaxError: invalid syntax (line 3) CREATE FUNCTION subtransaction_exit_subtransaction_in_with() RETURNS void AS $$ -with plpy.subtransaction() as s: - s.__exit__(None, None, None) +try: + with plpy.subtransaction() as s: + s.__exit__(None, None, None) +except ValueError, e: + raise ValueError(e) $$ LANGUAGE plpythonu; ERROR: could not compile PL/Python function "subtransaction_exit_subtransaction_in_with" -DETAIL: SyntaxError: invalid syntax (line 3) +DETAIL: SyntaxError: invalid syntax (line 4) SELECT subtransaction_exit_without_enter(); ERROR: ValueError: this subtransaction has not been entered CONTEXT: Traceback (most recent call last): diff --git a/src/pl/plpython/expected/plpython_subtransaction_5.out b/src/pl/plpython/expected/plpython_subtransaction_5.out index e172e98f86a..881d832560a 100644 --- a/src/pl/plpython/expected/plpython_subtransaction_5.out +++ b/src/pl/plpython/expected/plpython_subtransaction_5.out @@ -222,11 +222,14 @@ ERROR: could not compile PL/Python function "subtransaction_enter_subtransactio DETAIL: SyntaxError: invalid syntax (<string>, line 3) CREATE FUNCTION subtransaction_exit_subtransaction_in_with() RETURNS void AS $$ -with plpy.subtransaction() as s: - s.__exit__(None, None, None) +try: + with plpy.subtransaction() as s: + s.__exit__(None, None, None) +except ValueError, e: + raise ValueError(e) $$ LANGUAGE plpythonu; ERROR: could not compile PL/Python function "subtransaction_exit_subtransaction_in_with" -DETAIL: SyntaxError: invalid syntax (<string>, line 3) +DETAIL: SyntaxError: invalid syntax (<string>, line 4) SELECT subtransaction_exit_without_enter(); ERROR: ValueError: this subtransaction has not been entered CONTEXT: Traceback (most recent call last): diff --git a/src/pl/plpython/sql/plpython_subtransaction.sql b/src/pl/plpython/sql/plpython_subtransaction.sql index 572930f8bf2..ebd3c6e4167 100644 --- a/src/pl/plpython/sql/plpython_subtransaction.sql +++ b/src/pl/plpython/sql/plpython_subtransaction.sql @@ -161,7 +161,7 @@ AS $$ try: with plpy.subtransaction() as s: s.__exit__(None, None, None) -except ValueError as e: +except ValueError, e: raise ValueError(e) $$ LANGUAGE plpythonu; |