From db23464715f4792298c639153dda7bfd9ad9d602 Mon Sep 17 00:00:00 2001
From: Andres Freund <andres@anarazel.de>
Date: Mon, 7 Mar 2022 18:19:56 -0800
Subject: 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
---
 src/pl/plpython/sql/plpython_transaction.sql | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

(limited to 'src/pl/plpython/sql/plpython_transaction.sql')

diff --git a/src/pl/plpython/sql/plpython_transaction.sql b/src/pl/plpython/sql/plpython_transaction.sql
index 68588d9fb0..c939ba76d4 100644
--- a/src/pl/plpython/sql/plpython_transaction.sql
+++ b/src/pl/plpython/sql/plpython_transaction.sql
@@ -2,7 +2,7 @@ CREATE TABLE test1 (a int, b text);
 
 
 CREATE PROCEDURE transaction_test1()
-LANGUAGE plpythonu
+LANGUAGE plpython3u
 AS $$
 for i in range(0, 10):
     plpy.execute("INSERT INTO test1 (a) VALUES (%d)" % i)
@@ -20,7 +20,7 @@ SELECT * FROM test1;
 TRUNCATE test1;
 
 DO
-LANGUAGE plpythonu
+LANGUAGE plpython3u
 $$
 for i in range(0, 10):
     plpy.execute("INSERT INTO test1 (a) VALUES (%d)" % i)
@@ -37,7 +37,7 @@ TRUNCATE test1;
 
 -- not allowed in a function
 CREATE FUNCTION transaction_test2() RETURNS int
-LANGUAGE plpythonu
+LANGUAGE plpython3u
 AS $$
 for i in range(0, 10):
     plpy.execute("INSERT INTO test1 (a) VALUES (%d)" % i)
@@ -55,7 +55,7 @@ SELECT * FROM test1;
 
 -- also not allowed if procedure is called from a function
 CREATE FUNCTION transaction_test3() RETURNS int
-LANGUAGE plpythonu
+LANGUAGE plpython3u
 AS $$
 plpy.execute("CALL transaction_test1()")
 return 1
@@ -68,9 +68,9 @@ SELECT * FROM test1;
 
 -- DO block inside function
 CREATE FUNCTION transaction_test4() RETURNS int
-LANGUAGE plpythonu
+LANGUAGE plpython3u
 AS $$
-plpy.execute("DO LANGUAGE plpythonu $x$ plpy.commit() $x$")
+plpy.execute("DO LANGUAGE plpython3u $x$ plpy.commit() $x$")
 return 1
 $$;
 
@@ -78,7 +78,7 @@ SELECT transaction_test4();
 
 
 -- commit inside subtransaction (prohibited)
-DO LANGUAGE plpythonu $$
+DO LANGUAGE plpython3u $$
 s = plpy.subtransaction()
 s.enter()
 plpy.commit()
@@ -91,7 +91,7 @@ INSERT INTO test2 VALUES (0), (1), (2), (3), (4);
 
 TRUNCATE test1;
 
-DO LANGUAGE plpythonu $$
+DO LANGUAGE plpython3u $$
 for row in plpy.cursor("SELECT * FROM test2 ORDER BY x"):
     plpy.execute("INSERT INTO test1 (a) VALUES (%s)" % row['x'])
     plpy.commit()
@@ -106,7 +106,7 @@ SELECT * FROM pg_cursors;
 -- error in cursor loop with commit
 TRUNCATE test1;
 
-DO LANGUAGE plpythonu $$
+DO LANGUAGE plpython3u $$
 for row in plpy.cursor("SELECT * FROM test2 ORDER BY x"):
     plpy.execute("INSERT INTO test1 (a) VALUES (12/(%s-2))" % row['x'])
     plpy.commit()
@@ -120,7 +120,7 @@ SELECT * FROM pg_cursors;
 -- rollback inside cursor loop
 TRUNCATE test1;
 
-DO LANGUAGE plpythonu $$
+DO LANGUAGE plpython3u $$
 for row in plpy.cursor("SELECT * FROM test2 ORDER BY x"):
     plpy.execute("INSERT INTO test1 (a) VALUES (%s)" % row['x'])
     plpy.rollback()
@@ -134,7 +134,7 @@ SELECT * FROM pg_cursors;
 -- first commit then rollback inside cursor loop
 TRUNCATE test1;
 
-DO LANGUAGE plpythonu $$
+DO LANGUAGE plpython3u $$
 for row in plpy.cursor("SELECT * FROM test2 ORDER BY x"):
     plpy.execute("INSERT INTO test1 (a) VALUES (%s)" % row['x'])
     if row['x'] % 2 == 0:
@@ -152,7 +152,7 @@ SELECT * FROM pg_cursors;
 CREATE TABLE testpk (id int PRIMARY KEY);
 CREATE TABLE testfk(f1 int REFERENCES testpk DEFERRABLE INITIALLY DEFERRED);
 
-DO LANGUAGE plpythonu $$
+DO LANGUAGE plpython3u $$
 # this insert will fail during commit:
 plpy.execute("INSERT INTO testfk VALUES (0)")
 plpy.commit()
@@ -162,7 +162,7 @@ $$;
 SELECT * FROM testpk;
 SELECT * FROM testfk;
 
-DO LANGUAGE plpythonu $$
+DO LANGUAGE plpython3u $$
 # this insert will fail during commit:
 plpy.execute("INSERT INTO testfk VALUES (0)")
 try:
-- 
cgit v1.2.1

