Procedural language

A programming language which can be used to write functions which can be invoked from SQL

PostgreSQL provides the ability create user-defined functions or trigger procedures in languages other than SQL and C. These languages are referred to as "Procedural Languages" (PLs) and are a powerful way of extending PostgreSQL.

PostgreSQL's inbuilt procedural language is PL/pgSQL and is present by default in all databases. Three other procedural languages - PL/Perl, PL/Python and PL/Tcl - form part of the base PostgreSQL distribution but need to be explicitly enabled when compiling PostgreSQL. (Most package management systems include these as seperate packages).

A number of other procedural languages maintained by third-party projects but not included in the PostgreSQL base distribution are also available; see the list below for details.

Note that procedural languages (with the exception of PL/pgSQL) must be explicitly enabled for each database where they are to be used. Procedural languages can only be enabled by a database superuser.

Available procedural languages

Core procedural languages

Externally maintained procedural languages

  • PL/Java
  • PL/PHP
  • PL/Py
  • PL/R
  • PL/Ruby
  • PL/Scheme
  • PL/sh
  • PL/v8


Procedural language

See also