PL/Python
lastmod 2026-11-10created 2022-03-032 edits
PL/Python is a procedural language extension for PostgreSQL that lets you write stored functions and procedures in Python. After installing it with CREATE EXTENSION plpython3u, you write the function body as Python code and run database queries through the plpy module. It is classified as an untrusted language, so only superusers can create functions, and it is used for string processing that is awkward to express in SQL or PL/pgSQL and for making use of external libraries.