When performing an upgrade from Greenplum Database (GPDB) 6 to GPDB 7 using gpupgrade 2.0, the initialize stage may fail with errors related to plpython functions residing in the pg_catalog schema. The functions_in_pg_catalog.txt file generated by the utility lists objects such as:
pg_catalog.plpython_call_handler()pg_catalog.plpython_inline_handler(internal)pg_catalog.plpython_validator(oid)Customers may be concerned that dropping these system-level objects will break Python functionality in the target GPDB 7 environment.
These functions are legacy Python 2 (plpythonu) background metadata drivers. They are flagged during the upgrade initialization because of a metadata inconsistency from prior database upgrades that incorrectly identifies these internal drivers as "user objects."
Greenplum 7 has completely removed support for Python 2. These functions are obsolete and do not exist in GPDB 7; therefore, they cannot be migrated and must be removed to satisfy the upgrade validation checks.
Dropping these legacy functions is safe and will not impact Python functionality in Greenplum 7, as GPDB 7 utilizes a new set of system objects specifically for Python 3 (plpython3u).
Ensure there are no actual business functions dependent on Python 2. If gpupgrade does not generate a file named plpython2_dependent_functions.txt, or if that file is empty, no production code is at risk.
In the Greenplum 6 source cluster, drop the legacy Python extension. This will remove the orphaned pg_catalog objects:
Rerun the gpupgrade initialize command. The validation check for pg_catalog functions should now pass.
After successfully upgrading to Greenplum 7, install the new Python 3 environment drivers:
Test your custom Python functions to ensure compatibility with Python 3.11, as there may be syntax or library differences between GPDB 6 (Python 3.9) and GPDB 7 (Python 3.11).