summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2021-06-17 16:37:13 +0200
committerPeter Eisentraut <peter@eisentraut.org>2021-06-18 06:52:48 +0200
commitec52b886d1dd8c08993b391753d450488e18f330 (patch)
tree455993f88d1e0ddc0fed077f744fd350f9c2b982
parent009ee51af7fd6a8dd9c518f2e6d62a4f139c766a (diff)
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.
-rw-r--r--src/pl/plpython/expected/plpython_subtransaction.out2
-rw-r--r--src/pl/plpython/expected/plpython_subtransaction_0.out9
-rw-r--r--src/pl/plpython/expected/plpython_subtransaction_5.out9
-rw-r--r--src/pl/plpython/sql/plpython_subtransaction.sql2
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 d9a830dfcc6..2a3253684f5 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 cc6d9c0e93d..b9abf84f323 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 c3be1302680..854d763a951 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;