]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Update plpython_subtransaction alternative expected files
authorPeter Eisentraut <peter@eisentraut.org>
Thu, 17 Jun 2021 14:37:13 +0000 (16:37 +0200)
committerPeter Eisentraut <peter@eisentraut.org>
Fri, 18 Jun 2021 04:52:48 +0000 (06:52 +0200)
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.

src/pl/plpython/expected/plpython_subtransaction.out
src/pl/plpython/expected/plpython_subtransaction_0.out
src/pl/plpython/expected/plpython_subtransaction_5.out
src/pl/plpython/sql/plpython_subtransaction.sql

index d9a830dfcc6960ec20f5daf560bffbd8c6cfb4af..2a3253684f544b329d0f9254e34f50099fb6fa46 100644 (file)
@@ -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();
index cc6d9c0e93d35a0b700a29f8a6d3b91a6fa7b03f..b9abf84f32396162d926fa35c12a59e6bf2e8883 100644 (file)
@@ -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):
index c3be1302680ea9df79923bfe2fbe6fe8dee6fcb3..854d763a951c37d3bb08092bce6dd06b3c6ac359 100644 (file)
@@ -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):
index 572930f8bf265e16eff8097953026957f49fcf7f..ebd3c6e4167414b8a97476bd815b2b2048901fd5 100644 (file)
@@ -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;