]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Use plpythonu in plpython tests added by commit 0b7719f74
authorRichard Guo <rguo@postgresql.org>
Mon, 29 Jun 2026 05:21:15 +0000 (14:21 +0900)
committerRichard Guo <rguo@postgresql.org>
Mon, 29 Jun 2026 05:21:15 +0000 (14:21 +0900)
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.

contrib/hstore_plpython/expected/hstore_plpython.out
contrib/hstore_plpython/sql/hstore_plpython.sql
contrib/jsonb_plpython/expected/jsonb_plpython.out
contrib/jsonb_plpython/sql/jsonb_plpython.sql
src/pl/plpython/expected/plpython_composite.out
src/pl/plpython/expected/plpython_spi.out
src/pl/plpython/expected/plpython_types.out
src/pl/plpython/sql/plpython_composite.sql
src/pl/plpython/sql/plpython_spi.sql
src/pl/plpython/sql/plpython_types.sql

index b1837715ce502bc62890fb474c9c4d32f889d234..121d0248d4cd88e13f4ddbbdcea0d148f661db9d 100644 (file)
@@ -46,7 +46,7 @@ PL/Python function "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):
@@ -62,7 +62,7 @@ CONTEXT:  while creating return value
 PL/Python function "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):
@@ -78,7 +78,7 @@ CONTEXT:  while creating return value
 PL/Python function "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):
@@ -94,7 +94,7 @@ CONTEXT:  while creating return value
 PL/Python function "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):
index 8548b7dbe037b0506bfd8a098415566f0a27fad9..9923349dc0af6b924c39df8bf55efce9c6c2e386 100644 (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):
index f9bde492095a233815aaa41c553721a37cc26e5d..36712f45596f646b6ac4cc465e64df65f9871bdb 100644 (file)
@@ -307,7 +307,7 @@ SELECT test_dict1();
 -- A custom sequence whose __getitem__ raises should be reported as an error,
 -- not crash the backend
 CREATE FUNCTION test_broken_sequence() RETURNS jsonb
-LANGUAGE plpython3u
+LANGUAGE plpythonu
 TRANSFORM FOR TYPE jsonb
 AS $$
 class C:
@@ -326,7 +326,7 @@ PL/Python function "test_broken_sequence"
 -- A mapping whose items() raises should be reported as an error, not crash
 -- the backend
 CREATE FUNCTION test_broken_mapping() RETURNS jsonb
-LANGUAGE plpython3u
+LANGUAGE plpythonu
 TRANSFORM FOR TYPE jsonb
 AS $$
 class C(dict):
@@ -344,7 +344,7 @@ while creating return value
 PL/Python function "test_broken_mapping"
 -- Likewise for a mapping whose items() does not return key/value pairs
 CREATE FUNCTION test_malformed_mapping() RETURNS jsonb
-LANGUAGE plpython3u
+LANGUAGE plpythonu
 TRANSFORM FOR TYPE jsonb
 AS $$
 class C(dict):
@@ -360,7 +360,7 @@ CONTEXT:  while creating return value
 PL/Python function "test_malformed_mapping"
 -- Likewise for a mapping whose items() yields fewer pairs than its length
 CREATE FUNCTION test_short_mapping() RETURNS jsonb
-LANGUAGE plpython3u
+LANGUAGE plpythonu
 TRANSFORM FOR TYPE jsonb
 AS $$
 class C(dict):
@@ -377,7 +377,7 @@ CONTEXT:  while creating return value
 PL/Python function "test_short_mapping"
 -- Likewise for a mapping whose __len__() raises
 CREATE FUNCTION test_broken_len_mapping() RETURNS jsonb
-LANGUAGE plpython3u
+LANGUAGE plpythonu
 TRANSFORM FOR TYPE jsonb
 AS $$
 class C(dict):
index 78578fa3d8a3e77f6c03df4f4682518d7c8340da..40832a49b3ab230e45c33e135d470f1af9a87c6f 100644 (file)
@@ -185,7 +185,7 @@ SELECT test_dict1();
 -- A custom sequence whose __getitem__ raises should be reported as an error,
 -- not crash the backend
 CREATE FUNCTION test_broken_sequence() RETURNS jsonb
-LANGUAGE plpython3u
+LANGUAGE plpythonu
 TRANSFORM FOR TYPE jsonb
 AS $$
 class C:
@@ -201,7 +201,7 @@ SELECT test_broken_sequence();
 -- A mapping whose items() raises should be reported as an error, not crash
 -- the backend
 CREATE FUNCTION test_broken_mapping() RETURNS jsonb
-LANGUAGE plpython3u
+LANGUAGE plpythonu
 TRANSFORM FOR TYPE jsonb
 AS $$
 class C(dict):
@@ -216,7 +216,7 @@ SELECT test_broken_mapping();
 
 -- Likewise for a mapping whose items() does not return key/value pairs
 CREATE FUNCTION test_malformed_mapping() RETURNS jsonb
-LANGUAGE plpython3u
+LANGUAGE plpythonu
 TRANSFORM FOR TYPE jsonb
 AS $$
 class C(dict):
@@ -231,7 +231,7 @@ SELECT test_malformed_mapping();
 
 -- Likewise for a mapping whose items() yields fewer pairs than its length
 CREATE FUNCTION test_short_mapping() RETURNS jsonb
-LANGUAGE plpython3u
+LANGUAGE plpythonu
 TRANSFORM FOR TYPE jsonb
 AS $$
 class C(dict):
@@ -246,7 +246,7 @@ SELECT test_short_mapping();
 
 -- Likewise for a mapping whose __len__() raises
 CREATE FUNCTION test_broken_len_mapping() RETURNS jsonb
-LANGUAGE plpython3u
+LANGUAGE plpythonu
 TRANSFORM FOR TYPE jsonb
 AS $$
 class C(dict):
index a860dd24a572b2238b8e1023976bbf59f0ec933c..e503de54b62f0d7d47cbf5ceebf32bc31924c8e6 100644 (file)
@@ -615,7 +615,7 @@ class C:
     def __getitem__(self, i):
         raise ValueError('getitem failed')
 return C()
-$$ LANGUAGE plpython3u;
+$$ LANGUAGE plpythonu;
 SELECT * FROM composite_type_as_broken_sequence();
 ERROR:  could not get element 0 from sequence
 DETAIL:  ValueError: getitem failed
index eeed3d25a7b412fb8cc2f9cb35229508fa463709..6cd9275b766c53b277a8267f7558c8adf0a5b520 100644 (file)
@@ -474,7 +474,7 @@ class C:
     def __getitem__(self, i):
         raise ValueError('getitem failed')
 plpy.execute(plan, C())
-$$ LANGUAGE plpython3u;
+$$ LANGUAGE plpythonu;
 SELECT plan_broken_arg_sequence();
 ERROR:  spiexceptions.ExternalRoutineException: could not get element 0 from sequence
 DETAIL:  ValueError: getitem failed
@@ -490,7 +490,7 @@ class C:
     def __getitem__(self, i):
         raise ValueError('getitem failed')
 plpy.prepare("select $1", C())
-$$ LANGUAGE plpython3u;
+$$ LANGUAGE plpythonu;
 SELECT prepare_broken_type_sequence();
 ERROR:  spiexceptions.ExternalRoutineException: could not get element 0 from sequence
 DETAIL:  ValueError: getitem failed
@@ -507,7 +507,7 @@ class C:
     def __getitem__(self, i):
         raise ValueError('getitem failed')
 plpy.cursor(plan, C())
-$$ LANGUAGE plpython3u;
+$$ LANGUAGE plpythonu;
 SELECT cursor_broken_arg_sequence();
 ERROR:  spiexceptions.ExternalRoutineException: could not get element 0 from sequence
 DETAIL:  ValueError: getitem failed
index 6ef55a4efcc93ead5fdf1c724f59e622b2231585..98c7428eebf49fc1189acc1e0cdbd39fe3f43a7d 100644 (file)
@@ -805,7 +805,7 @@ class C:
     def __getitem__(self, i):
         raise ValueError('getitem failed')
 return C()
-$$ LANGUAGE plpython3u;
+$$ LANGUAGE plpythonu;
 SELECT * FROM test_type_conversion_array_getitem_fail();
 ERROR:  could not get element 0 from sequence
 DETAIL:  ValueError: getitem failed
index d7ac6463c1c865e946c520e7835ed5ea0c195881..5537d754721ffd4c38b2746d261dd8165897a232 100644 (file)
@@ -243,5 +243,5 @@ class C:
     def __getitem__(self, i):
         raise ValueError('getitem failed')
 return C()
-$$ LANGUAGE plpython3u;
+$$ LANGUAGE plpythonu;
 SELECT * FROM composite_type_as_broken_sequence();
index 93d2b0d90cdb94e1e84b202b560523ed6d102838..95481580c7b7fd820fade16b3b8799af8600ccb2 100644 (file)
@@ -331,7 +331,7 @@ class C:
     def __getitem__(self, i):
         raise ValueError('getitem failed')
 plpy.execute(plan, C())
-$$ LANGUAGE plpython3u;
+$$ LANGUAGE plpythonu;
 
 SELECT plan_broken_arg_sequence();
 
@@ -343,7 +343,7 @@ class C:
     def __getitem__(self, i):
         raise ValueError('getitem failed')
 plpy.prepare("select $1", C())
-$$ LANGUAGE plpython3u;
+$$ LANGUAGE plpythonu;
 
 SELECT prepare_broken_type_sequence();
 
@@ -356,6 +356,6 @@ class C:
     def __getitem__(self, i):
         raise ValueError('getitem failed')
 plpy.cursor(plan, C())
-$$ LANGUAGE plpython3u;
+$$ LANGUAGE plpythonu;
 
 SELECT cursor_broken_arg_sequence();
index b64fac4d17f82fff5a71311f1a70c837bffb1995..5a6fdb26b14ea91fc8f292d47e0ae5b749ffe537 100644 (file)
@@ -426,7 +426,7 @@ class C:
     def __getitem__(self, i):
         raise ValueError('getitem failed')
 return C()
-$$ LANGUAGE plpython3u;
+$$ LANGUAGE plpythonu;
 
 SELECT * FROM test_type_conversion_array_getitem_fail();