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_composite.sql | 32 +++++++++++++++---------------
 1 file changed, 16 insertions(+), 16 deletions(-)

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

diff --git a/src/pl/plpython/sql/plpython_composite.sql b/src/pl/plpython/sql/plpython_composite.sql
index 0fd2f5d5e3..21757701cc 100644
--- a/src/pl/plpython/sql/plpython_composite.sql
+++ b/src/pl/plpython/sql/plpython_composite.sql
@@ -1,6 +1,6 @@
 CREATE FUNCTION multiout_simple(OUT i integer, OUT j integer) AS $$
 return (1, 2)
-$$ LANGUAGE plpythonu;
+$$ LANGUAGE plpython3u;
 
 SELECT multiout_simple();
 SELECT * FROM multiout_simple();
@@ -9,7 +9,7 @@ SELECT (multiout_simple()).j + 3;
 
 CREATE FUNCTION multiout_simple_setof(n integer = 1, OUT integer, OUT integer) RETURNS SETOF record AS $$
 return [(1, 2)] * n
-$$ LANGUAGE plpythonu;
+$$ LANGUAGE plpython3u;
 
 SELECT multiout_simple_setof();
 SELECT * FROM multiout_simple_setof();
@@ -34,7 +34,7 @@ elif typ == 'obj':
     return type_record
 elif typ == 'str':
     return "('%s',%r)" % (first, second)
-$$ LANGUAGE plpythonu;
+$$ LANGUAGE plpython3u;
 
 SELECT * FROM multiout_record_as('dict', 'foo', 1, 'f');
 SELECT multiout_record_as('dict', 'foo', 1, 'f');
@@ -77,7 +77,7 @@ for i in range(n):
     power = 2 ** i
     length = plpy.execute("select length('%d')" % power)[0]['length']
     yield power, length
-$$ LANGUAGE plpythonu;
+$$ LANGUAGE plpython3u;
 
 SELECT * FROM multiout_setof(3);
 SELECT multiout_setof(5);
@@ -86,7 +86,7 @@ CREATE FUNCTION multiout_return_table() RETURNS TABLE (x integer, y text) AS $$
 return [{'x': 4, 'y' :'four'},
         {'x': 7, 'y' :'seven'},
         {'x': 0, 'y' :'zero'}]
-$$ LANGUAGE plpythonu;
+$$ LANGUAGE plpython3u;
 
 SELECT * FROM multiout_return_table();
 
@@ -94,18 +94,18 @@ CREATE FUNCTION multiout_array(OUT integer[], OUT text) RETURNS SETOF record AS
 yield [[1], 'a']
 yield [[1,2], 'b']
 yield [[1,2,3], None]
-$$ LANGUAGE plpythonu;
+$$ LANGUAGE plpython3u;
 
 SELECT * FROM multiout_array();
 
 CREATE FUNCTION singleout_composite(OUT type_record) AS $$
 return {'first': 1, 'second': 2}
-$$ LANGUAGE plpythonu;
+$$ LANGUAGE plpython3u;
 
 CREATE FUNCTION multiout_composite(OUT type_record) RETURNS SETOF type_record AS $$
 return [{'first': 1, 'second': 2},
        {'first': 3, 'second': 4	}]
-$$ LANGUAGE plpythonu;
+$$ LANGUAGE plpython3u;
 
 SELECT * FROM singleout_composite();
 SELECT * FROM multiout_composite();
@@ -113,7 +113,7 @@ SELECT * FROM multiout_composite();
 -- composite OUT parameters in functions returning RECORD not supported yet
 CREATE FUNCTION multiout_composite(INOUT n integer, OUT type_record) AS $$
 return (n, (n * 2, n * 3))
-$$ LANGUAGE plpythonu;
+$$ LANGUAGE plpython3u;
 
 CREATE FUNCTION multiout_table_type_setof(typ text, returnnull boolean, INOUT n integer, OUT table_record) RETURNS SETOF record AS $$
 if returnnull:
@@ -132,7 +132,7 @@ elif typ == 'str':
     d = "(%r,%r)" % (n * 2, n * 3)
 for i in range(n):
     yield (i, d)
-$$ LANGUAGE plpythonu;
+$$ LANGUAGE plpython3u;
 
 SELECT * FROM multiout_composite(2);
 SELECT * FROM multiout_table_type_setof('dict', 'f', 3);
@@ -157,7 +157,7 @@ CREATE TABLE changing (
 CREATE FUNCTION changing_test(OUT n integer, OUT changing) RETURNS SETOF record AS $$
 return [(1, {'i': 1, 'j': 2}),
         (1, (3, 4))]
-$$ LANGUAGE plpythonu;
+$$ LANGUAGE plpython3u;
 
 SELECT * FROM changing_test();
 ALTER TABLE changing DROP COLUMN j;
@@ -178,14 +178,14 @@ yield {'tab': [('first', 1), ('second', 2)],
 yield {'tab': [('first', 1), ('second', 2)],
       'typ': [{'first': 'third', 'second': 3},
               {'first': 'fourth', 'second': 4}]}
-$$ LANGUAGE plpythonu;
+$$ LANGUAGE plpython3u;
 
 SELECT * FROM composite_types_table();
 
 -- check what happens if the output record descriptor changes
 CREATE FUNCTION return_record(t text) RETURNS record AS $$
 return {'t': t, 'val': 10}
-$$ LANGUAGE plpythonu;
+$$ LANGUAGE plpython3u;
 
 SELECT * FROM return_record('abc') AS r(t text, val integer);
 SELECT * FROM return_record('abc') AS r(t text, val bigint);
@@ -196,7 +196,7 @@ SELECT * FROM return_record('999') AS r(val text, t integer);
 
 CREATE FUNCTION return_record_2(t text) RETURNS record AS $$
 return {'v1':1,'v2':2,t:3}
-$$ LANGUAGE plpythonu;
+$$ LANGUAGE plpython3u;
 
 SELECT * FROM return_record_2('v3') AS (v3 int, v2 int, v1 int);
 SELECT * FROM return_record_2('v3') AS (v2 int, v3 int, v1 int);
@@ -211,7 +211,7 @@ SELECT * FROM return_record_2('v3') AS (v1 int, v2 int, v3 int);
 -- multi-dimensional array of composite types.
 CREATE FUNCTION composite_type_as_list()  RETURNS type_record[] AS $$
   return [[('first', 1), ('second', 1)], [('first', 2), ('second', 2)], [('first', 3), ('second', 3)]];
-$$ LANGUAGE plpythonu;
+$$ LANGUAGE plpython3u;
 SELECT * FROM composite_type_as_list();
 
 -- Starting with PostgreSQL 10, a composite type in an array cannot be
@@ -220,5 +220,5 @@ SELECT * FROM composite_type_as_list();
 -- on the issue.
 CREATE FUNCTION composite_type_as_list_broken()  RETURNS type_record[] AS $$
   return [['first', 1]];
-$$ LANGUAGE plpythonu;
+$$ LANGUAGE plpython3u;
 SELECT * FROM composite_type_as_list_broken();
-- 
cgit v1.2.1

