1
0
mirror of https://github.com/postgres/postgres.git synced 2026-10-23 13:29:09 +03:00

Use plpythonu in plpython tests added by commit 0b7719f74

Commit 0b7719f74 added regression tests that spell the language name
as plpython3u.  That works on the master branch, but on v14 the
plpython tests must use the unversioned name plpythonu: the plpython3u
extension is built only in Python 3 builds, and for those builds
regress-python3-mangle.mk rewrites plpythonu to plpython3u in the test
files.  In a Python 2 build the new tests instead failed with
"language \"plpython3u\" does not exist".

Spell the language as plpythonu in the new tests, matching every other
plpython test in this branch, so they work in both Python 2 and Python
3 builds.  This is needed only in v14; later branches no longer
support Python 2 and have dropped the mangling step.

Per buildfarm member hippopotamus.
This commit is contained in:
Richard Guo
2026-06-29 14:21:15 +09:00
parent 0b7719f744
commit 309dc4526d
10 changed files with 28 additions and 28 deletions

View File

@@ -41,7 +41,7 @@ SELECT test1bad();
-- A mapping whose items() raises should be reported as an error, not crash
-- the backend
CREATE FUNCTION test1broken() RETURNS hstore
LANGUAGE plpython3u
LANGUAGE plpythonu
TRANSFORM FOR TYPE hstore
AS $$
class C(dict):
@@ -57,7 +57,7 @@ SELECT test1broken();
-- Likewise for a mapping whose items() does not return key/value pairs
CREATE FUNCTION test1malformed() RETURNS hstore
LANGUAGE plpython3u
LANGUAGE plpythonu
TRANSFORM FOR TYPE hstore
AS $$
class C(dict):
@@ -73,7 +73,7 @@ SELECT test1malformed();
-- Likewise for a mapping whose items() yields fewer pairs than its length
CREATE FUNCTION test1short() RETURNS hstore
LANGUAGE plpython3u
LANGUAGE plpythonu
TRANSFORM FOR TYPE hstore
AS $$
class C(dict):
@@ -89,7 +89,7 @@ SELECT test1short();
-- Likewise for a mapping whose __len__() raises
CREATE FUNCTION test1brokenlen() RETURNS hstore
LANGUAGE plpython3u
LANGUAGE plpythonu
TRANSFORM FOR TYPE hstore
AS $$
class C(dict):