GUC plpython3.python_path is missing from pg_settings
search cancel

GUC plpython3.python_path is missing from pg_settings

book

Article ID: 442162

calendar_today

Updated On:

Products

VMware Tanzu Data Suite

Issue/Introduction

Symptoms

When attempting to query the pg_settings system view to pull out parameters, specific PL/Python parameters such as plpython3.python_path do not appear in the results.

Running a query similar to the following returns zero rows:

SELECT name, setting FROM pg_settings WHERE name ~ 'python_path';

Cause

Cause

The plpython3.python_path GUC is defined dynamically within the PL/Python shared library (plpython3.so). Greenplum (and underlying PostgreSQL) does not load this shared library into the server process by default for every user session.

As a result, the server process will not recognize this GUC or display it in pg_settings until the library is actively loaded into the current session.

 

Resolution

Resolution / Workaround

This behavior is expected. The library is loaded automatically whenever a plpython3 function is executed within the session.

If you need to query or set this GUC directly without running a function first, you must manually load the shared library into your session using the LOAD command.

For example:

  1. Connect to the database. Notice that initially, the GUC is not recognized:

    [gpadmin@[local]] gpadmin=# SELECT name, setting FROM pg_settings WHERE name ~ 'python_path';
     name | setting 
    ------+---------
    (0 rows)
    
  2. Manually load the PL/Python shared library:

    [gpadmin@[local]] gpadmin=# LOAD 'plpython3';
    LOAD
    
  3. Query pg_settings again. The GUC will now be visible and accessible for the duration of the session:

    [gpadmin@[local]] gpadmin=# SELECT name, setting FROM pg_settings WHERE name ~ 'python_path';
             name          |         setting         
    -----------------------+-------------------------
     plpython3.python_path | /home/gpadmin/my_python
    (1 row)