postgresql/src/pl/plpython/sql/plpython_global.sql
Andres Freund db23464715 plpython: Remove regression test infrastructure for Python 2.
Since 19252e8ec9 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
2022-03-07 18:20:51 -08:00

38 lines
904 B
SQL

--
-- check static and global data (SD and GD)
--
CREATE FUNCTION global_test_one() returns text
AS
'if "global_test" not in SD:
SD["global_test"] = "set by global_test_one"
if "global_test" not in GD:
GD["global_test"] = "set by global_test_one"
return "SD: " + SD["global_test"] + ", GD: " + GD["global_test"]'
LANGUAGE plpython3u;
CREATE FUNCTION global_test_two() returns text
AS
'if "global_test" not in SD:
SD["global_test"] = "set by global_test_two"
if "global_test" not in GD:
GD["global_test"] = "set by global_test_two"
return "SD: " + SD["global_test"] + ", GD: " + GD["global_test"]'
LANGUAGE plpython3u;
CREATE FUNCTION static_test() returns int4
AS
'if "call" in SD:
SD["call"] = SD["call"] + 1
else:
SD["call"] = 1
return SD["call"]
'
LANGUAGE plpython3u;
SELECT static_test();
SELECT static_test();
SELECT global_test_one();
SELECT global_test_two();