From 823751bdddd2828c29009d8def55990fda4935ed Mon Sep 17 00:00:00 2001 From: yihong0618 Date: Fri, 13 May 2022 06:37:33 -0400 Subject: [PATCH 1/2] fix: test case down for plpython3 --- src/pl/plpython/Makefile | 7 +++---- src/pl/plpython/plpy_main.c | 4 +++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/pl/plpython/Makefile b/src/pl/plpython/Makefile index ed337528e69d..24e241e3e979 100644 --- a/src/pl/plpython/Makefile +++ b/src/pl/plpython/Makefile @@ -87,11 +87,10 @@ SHLIB_LINK = $(python_libspec) $(python_additional_libs) $(filter -lintl,$(LIBS) REGRESS_OPTS = --dbname=$(PL_TESTDB) --init-file=$(srcdir)/init_file # Only load plpythonu with Python 2. The test files themselves load -# the versioned language plpython(2|3)u. +# for plpython3 extension name is the same as language name. +# we do not need to load again. ifeq ($(python_majorversion),2) -REGRESS_OPTS += --load-extension=plpythonu -else -REGRESS_OPTS += --load-extension=plpython3u +REGRESS_OPTS += --load-extension=plpython2u endif REGRESS = \ diff --git a/src/pl/plpython/plpy_main.c b/src/pl/plpython/plpy_main.c index 4425d593d57a..43492071e572 100644 --- a/src/pl/plpython/plpy_main.c +++ b/src/pl/plpython/plpy_main.c @@ -199,9 +199,11 @@ PLy_initialize(void) */ if (plpython3_path && *plpython3_path) setenv("PYTHONPATH", plpython3_path, 1); - else + else + { unsetenv("PYTHONPATH"); unsetenv("PYTHONHOME"); + } #endif /* The rest should only be done once per session */ if (inited) From aca7c6850db031a52a4ff0d050d5ffa60c0766bf Mon Sep 17 00:00:00 2001 From: yihong0618 Date: Fri, 13 May 2022 06:39:08 -0400 Subject: [PATCH 2/2] fix: plpython2u --- src/pl/plpython/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pl/plpython/Makefile b/src/pl/plpython/Makefile index 24e241e3e979..c5989569fc23 100644 --- a/src/pl/plpython/Makefile +++ b/src/pl/plpython/Makefile @@ -90,7 +90,7 @@ REGRESS_OPTS = --dbname=$(PL_TESTDB) --init-file=$(srcdir)/init_file # for plpython3 extension name is the same as language name. # we do not need to load again. ifeq ($(python_majorversion),2) -REGRESS_OPTS += --load-extension=plpython2u +REGRESS_OPTS += --load-extension=plpythonu endif REGRESS = \