summaryrefslogtreecommitdiff
path: root/src/pl/plpython/sql/plpython_subtransaction.sql
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2022-03-07 18:19:56 -0800
committerAndres Freund <andres@anarazel.de>2022-03-07 18:20:51 -0800
commitdb23464715f4792298c639153dda7bfd9ad9d602 (patch)
tree57db9275a7ea3b84fab2d8c65153710e9465465a /src/pl/plpython/sql/plpython_subtransaction.sql
parent76a29adee749f41e277459cbf2e47a2ff7777f31 (diff)
downloadpostgresql-db23464715f4792298c639153dda7bfd9ad9d602.tar.gz
plpython: Remove regression test infrastructure for Python 2.
Since 19252e8ec93 we reject Python 2 during build configuration. Now that the dust on the buildfarm has settled, remove regression testing infrastructure dealing with differing output between Python 2 / 3. Reviewed-By: Peter Eisentraut <peter@eisentraut.org> Reviewed-By: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/20211031184548.g4sxfe47n2kyi55r@alap3.anarazel.de
Diffstat (limited to 'src/pl/plpython/sql/plpython_subtransaction.sql')
-rw-r--r--src/pl/plpython/sql/plpython_subtransaction.sql38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/pl/plpython/sql/plpython_subtransaction.sql b/src/pl/plpython/sql/plpython_subtransaction.sql
index cc4b1ae102..c65c380f40 100644
--- a/src/pl/plpython/sql/plpython_subtransaction.sql
+++ b/src/pl/plpython/sql/plpython_subtransaction.sql
@@ -17,7 +17,7 @@ with plpy.subtransaction():
plpy.execute("INSERT INTO subtransaction_tbl VALUES ('oops')")
elif what_error == "Python":
raise Exception("Python exception")
-$$ LANGUAGE plpythonu;
+$$ LANGUAGE plpython3u;
SELECT subtransaction_ctx_test();
SELECT * FROM subtransaction_tbl;
@@ -45,7 +45,7 @@ with plpy.subtransaction():
raise
plpy.notice("Swallowed %s(%r)" % (e.__class__.__name__, e.args[0]))
return "ok"
-$$ LANGUAGE plpythonu;
+$$ LANGUAGE plpython3u;
SELECT subtransaction_nested_test();
SELECT * FROM subtransaction_tbl;
@@ -65,7 +65,7 @@ with plpy.subtransaction():
plpy.execute("INSERT INTO subtransaction_tbl VALUES (2)")
plpy.execute("SELECT subtransaction_nested_test('t')")
return "ok"
-$$ LANGUAGE plpythonu;
+$$ LANGUAGE plpython3u;
SELECT subtransaction_deeply_nested_test();
SELECT * FROM subtransaction_tbl;
@@ -76,25 +76,25 @@ TRUNCATE subtransaction_tbl;
CREATE FUNCTION subtransaction_exit_without_enter() RETURNS void
AS $$
plpy.subtransaction().__exit__(None, None, None)
-$$ LANGUAGE plpythonu;
+$$ LANGUAGE plpython3u;
CREATE FUNCTION subtransaction_enter_without_exit() RETURNS void
AS $$
plpy.subtransaction().__enter__()
-$$ LANGUAGE plpythonu;
+$$ LANGUAGE plpython3u;
CREATE FUNCTION subtransaction_exit_twice() RETURNS void
AS $$
plpy.subtransaction().__enter__()
plpy.subtransaction().__exit__(None, None, None)
plpy.subtransaction().__exit__(None, None, None)
-$$ LANGUAGE plpythonu;
+$$ LANGUAGE plpython3u;
CREATE FUNCTION subtransaction_enter_twice() RETURNS void
AS $$
plpy.subtransaction().__enter__()
plpy.subtransaction().__enter__()
-$$ LANGUAGE plpythonu;
+$$ LANGUAGE plpython3u;
CREATE FUNCTION subtransaction_exit_same_subtransaction_twice() RETURNS void
AS $$
@@ -102,7 +102,7 @@ s = plpy.subtransaction()
s.__enter__()
s.__exit__(None, None, None)
s.__exit__(None, None, None)
-$$ LANGUAGE plpythonu;
+$$ LANGUAGE plpython3u;
CREATE FUNCTION subtransaction_enter_same_subtransaction_twice() RETURNS void
AS $$
@@ -110,14 +110,14 @@ s = plpy.subtransaction()
s.__enter__()
s.__enter__()
s.__exit__(None, None, None)
-$$ LANGUAGE plpythonu;
+$$ LANGUAGE plpython3u;
-- No warnings here, as the subtransaction gets indeed closed
CREATE FUNCTION subtransaction_enter_subtransaction_in_with() RETURNS void
AS $$
with plpy.subtransaction() as s:
s.__enter__()
-$$ LANGUAGE plpythonu;
+$$ LANGUAGE plpython3u;
CREATE FUNCTION subtransaction_exit_subtransaction_in_with() RETURNS void
AS $$
@@ -126,7 +126,7 @@ try:
s.__exit__(None, None, None)
except ValueError as e:
raise ValueError(e)
-$$ LANGUAGE plpythonu;
+$$ LANGUAGE plpython3u;
SELECT subtransaction_exit_without_enter();
SELECT subtransaction_enter_without_exit();
@@ -159,7 +159,7 @@ try:
plpy.execute(p, ["wrong"])
except plpy.SPIError:
plpy.warning("Caught a SPI error")
-$$ LANGUAGE plpythonu;
+$$ LANGUAGE plpython3u;
SELECT subtransaction_mix_explicit_and_implicit();
SELECT * FROM subtransaction_tbl;
@@ -172,7 +172,7 @@ AS $$
s = plpy.subtransaction()
s.enter()
s.exit(None, None, None)
-$$ LANGUAGE plpythonu;
+$$ LANGUAGE plpython3u;
SELECT subtransaction_alternative_names();
@@ -186,7 +186,7 @@ with plpy.subtransaction():
plpy.execute("INSERT INTO subtransaction_tbl VALUES ('a')")
except plpy.SPIError:
plpy.notice("caught")
-$$ LANGUAGE plpythonu;
+$$ LANGUAGE plpython3u;
SELECT try_catch_inside_subtransaction();
SELECT * FROM subtransaction_tbl;
@@ -202,7 +202,7 @@ with plpy.subtransaction():
plpy.execute("INSERT INTO subtransaction_tbl VALUES (1)")
except plpy.SPIError:
plpy.notice("caught")
-$$ LANGUAGE plpythonu;
+$$ LANGUAGE plpython3u;
SELECT pk_violation_inside_subtransaction();
SELECT * FROM subtransaction_tbl;
@@ -217,7 +217,7 @@ with plpy.subtransaction():
cur.fetch(10)
fetched = cur.fetch(10);
return int(fetched[5]["i"])
-$$ LANGUAGE plpythonu;
+$$ LANGUAGE plpython3u;
CREATE FUNCTION cursor_aborted_subxact() RETURNS int AS $$
try:
@@ -229,7 +229,7 @@ except plpy.SPIError:
fetched = cur.fetch(10)
return int(fetched[5]["i"])
return 0 # not reached
-$$ LANGUAGE plpythonu;
+$$ LANGUAGE plpython3u;
CREATE FUNCTION cursor_plan_aborted_subxact() RETURNS int AS $$
try:
@@ -243,7 +243,7 @@ except plpy.SPIError:
fetched = cur.fetch(5)
return fetched[2]["i"]
return 0 # not reached
-$$ LANGUAGE plpythonu;
+$$ LANGUAGE plpython3u;
CREATE FUNCTION cursor_close_aborted_subxact() RETURNS boolean AS $$
try:
@@ -254,7 +254,7 @@ except plpy.SPIError:
cur.close()
return True
return False # not reached
-$$ LANGUAGE plpythonu;
+$$ LANGUAGE plpython3u;
SELECT cursor_in_subxact();
SELECT cursor_aborted_subxact();