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.
procedural language is PL/pgSQL and is present by default in all databases. Three other procedural languages -
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.