Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
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>
Thu, 17 Jun 2021 14:39:13 +0000 (16:39 +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 d36aac127bb9e1c5139b4cca55c8c22a8497e7d3..d578c099d036dafc92620b757a75097a5b356ead 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 97ee42b5a9aeae69269bfd3bb5e5a3883d52bc21..45b57c2e77f4f3ab8f62fe664a832cbb977c5d20 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 e172e98f86a5f32809650df142bc614969ee6f0e..881d832560ab67daffeb0d6e9b254b316efe7b7c 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;