summaryrefslogtreecommitdiff
path: root/src/pl/plpython/sql/plpython_setof.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_setof.sql
parent76a29adee749f41e277459cbf2e47a2ff7777f31 (diff)
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_setof.sql')
-rw-r--r--src/pl/plpython/sql/plpython_setof.sql18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/pl/plpython/sql/plpython_setof.sql b/src/pl/plpython/sql/plpython_setof.sql
index 16c2eef0ad6..4cfb10192c0 100644
--- a/src/pl/plpython/sql/plpython_setof.sql
+++ b/src/pl/plpython/sql/plpython_setof.sql
@@ -4,21 +4,21 @@
CREATE FUNCTION test_setof_error() RETURNS SETOF text AS $$
return 37
-$$ LANGUAGE plpythonu;
+$$ LANGUAGE plpython3u;
SELECT test_setof_error();
CREATE FUNCTION test_setof_as_list(count integer, content text) RETURNS SETOF text AS $$
return [ content ]*count
-$$ LANGUAGE plpythonu;
+$$ LANGUAGE plpython3u;
CREATE FUNCTION test_setof_as_tuple(count integer, content text) RETURNS SETOF text AS $$
t = ()
for i in range(count):
t += ( content, )
return t
-$$ LANGUAGE plpythonu;
+$$ LANGUAGE plpython3u;
CREATE FUNCTION test_setof_as_iterator(count integer, content text) RETURNS SETOF text AS $$
class producer:
@@ -27,13 +27,13 @@ class producer:
self.icount = icount
def __iter__ (self):
return self
- def next (self):
+ def __next__ (self):
if self.icount == 0:
raise StopIteration
self.icount -= 1
return self.icontent
return producer(count, content)
-$$ LANGUAGE plpythonu;
+$$ LANGUAGE plpython3u;
CREATE FUNCTION test_setof_spi_in_iterator() RETURNS SETOF text AS
$$
@@ -42,7 +42,7 @@ $$
yield s
plpy.execute('select 2')
$$
-LANGUAGE plpythonu;
+LANGUAGE plpython3u;
-- Test set returning functions
@@ -69,7 +69,7 @@ global x
while x <= lim:
yield x
x = x + 1
-$$ LANGUAGE plpythonu;
+$$ LANGUAGE plpython3u;
SELECT ugly(1, 5);
@@ -81,7 +81,7 @@ CREATE OR REPLACE FUNCTION get_user_records()
RETURNS SETOF users
AS $$
return plpy.execute("SELECT * FROM users ORDER BY username")
-$$ LANGUAGE plpythonu;
+$$ LANGUAGE plpython3u;
SELECT get_user_records();
SELECT * FROM get_user_records();
@@ -91,7 +91,7 @@ CREATE OR REPLACE FUNCTION get_user_records2()
RETURNS TABLE(fname text, lname text, username text, userid int)
AS $$
return plpy.execute("SELECT * FROM users ORDER BY username")
-$$ LANGUAGE plpythonu;
+$$ LANGUAGE plpython3u;
SELECT get_user_records2();
SELECT * FROM get_user_records2();