Procedural Languages v7.6

Use procedural languages to write functions and procedures in a language other than SQL or C and call them from SQL. Running logic inside the database keeps computation close to your data and lets you reuse existing code. For example, you can wrap existing Python code in a PL/Python function and call it from a query.

Bundled languages

WarehousePG bundles these languages, so you don't need to install anything. Enable a language in each database where you want to use it with the CREATE EXTENSION command, and remove it with DROP EXTENSION. Only superusers can register untrusted languages. For the commands to enable each language, see Installing procedural languages.

  • PL/Perl - Write functions in Perl and use its string manipulation operators and functions. Extensions: plperl and plperlu.
  • PL/pgSQL - Group SQL statements and procedural logic inside the database server. Extension: plpgsql.
  • PL/Python - Write functions in Python and use Python modules. Extension: plpython3u.

Separately installed languages

Install these languages separately on every host before you enable them in a database. The page for each language describes how to install, enable, and use it.

  • PL/Java - Write functions in Java and run them in a Java virtual machine inside the database process. Extension: pljava.
  • PL/R - Write functions in R and use R packages for statistics and data analysis. Extension: plr.