Skip to content

plpy_venv

Select and manage Python virtual environments for PL/Python functions.

plpy_venv · Select and manage Python virtual environments for PL/Python functions.

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
101950plpy_venvplpy_venv1.0LANGSQL
Relationships
Requiresplpython3u

Usage

Sources:

plpy_venv Select and manage Python virtual environments for PL/Python functions.

Enablement

Install the files for the intended server, then create plpy_venv in the target database:

CREATE EXTENSION plpy_venv CASCADE;

The reviewed control or official workflow requires plpython3u. CASCADE only succeeds when those extension files are already installed on the server.

Core Workflow

The following example is taken from the reviewed upstream documentation. Adapt object names, paths, credentials, and workload values before use.

plpy=# SELECT plpy_venv.create_venv('myvenv');
ERROR:  plpy.Error: Virtual environment directory /path/to/postgresql/data/venvs/myvenv already exists.
CONTEXT:  Traceback (most recent call last):
  PL/Python function "create_venv", line 30, in <module>
    plpy.error('Virtual environment directory {} already exists.'.format(venv_dir))
PL/Python function "create_venv"

Main Objects

The official sources define the extension surface dynamically or through provider tooling; inspect the installed version before granting access.

Operations and Boundaries

  • The extension fixes or creates schema objects under plpy_venv; include them in privilege and backup review.
  • Catalog lifecycle is abandoned; test upgrades, dump/restore, and server compatibility before production use.

Table reader