encyclopegia.org

PL/pgSQL

PL/pgSQL (Procedural Language/PostgreSQL) is a procedural programming language supported by the PostgreSQL ORDBMS. It closely resembles Oracle's PL/SQL language. Implemented by Jan Wieck, PL/pgSQL first appeared with PostgreSQL 6.4, released on October 30, 1998. Version 9 also implements some ISO SQL/PSM features, like overloading of SQL-invoked functions and procedures. PL/pgSQL, as a fully featured programming language, allows much more procedural control than SQL, including the ability to use loops and other control structures. SQL statements and triggers can call functions created in the PL/pgSQL language. The design of PL/pgSQL aimed to allow PostgreSQL users to perform more complex operations and computations than SQL, while providing ease of use. The language is able to be defined as trusted by the server. PL/pgSQL is one of the programming languages included in the standard PostgreSQL distribution, the others being PL/Tcl, PL/Perl and PL/Python. In addition, many others are available from third parties, including PL/Java, PL/pgPSM, PL/php, PL/R, PL/Ruby, PL/sh, PL/Lua, Postmodern (based on Common Lisp) and PL/v8. PostgreSQL uses Bison as its parser, making it easy to port many open-source languages, as well as to reuse code.

PL/pgSQL (Procedural Language/PostgreSQL) is a procedural programming language supported by the PostgreSQL ORDBMS. It closely resembles Oracle's PL/SQL language. Implemented by Jan Wieck, PL/pgSQL first appeared with PostgreSQL 6.4, released on October 30, 1998. Version 9 also implements some ISO SQL/PSM features, like overloading of SQL-invoked functions and procedures. PL/pgSQL, as a fully featured programming language, allows much more procedural control than SQL, including the ability to use loops and other control structures. SQL statements and triggers can call functions created in the PL/pgSQL language. The design of PL/pgSQL aimed to allow PostgreSQL users to perform more complex operations and computations than SQL, while providing ease of use. The language is able to be defined as trusted by the server. PL/pgSQL is one of the programming languages included in the standard PostgreSQL distribution, the others being PL/Tcl, PL/Perl and PL/Python. In addition, many others are available from third parties, including PL/Java, PL/pgPSM, PL/php, PL/R, PL/Ruby, PL/sh, PL/Lua, Postmodern (based on Common Lisp) and PL/v8. PostgreSQL uses Bison as its parser, making it easy to port many open-source languages, as well as to reuse code. The following example is a function that computes the sales tax of a given subtotal: CREATE FUNCTION sales_tax(subtotal real) RETURNS real AS $$ BEGIN RETURN subtotal * 0.06; END; $$ LANGUAGE plpgsql; ==References== ==External links== Official PL/pgSQL documentation

References

No reference rows published for this article.

Cite this article

MLA

"PL/pgSQL." encyclopegia.org, 2025, https://encyclopegia.org/wiki/pl-pgsql. Accessed 24 November 2026.

Chicago

"PL/pgSQL." encyclopegia.org. Accessed November 24, 2026. https://encyclopegia.org/wiki/pl-pgsql.

APA

encyclopegia.org. (2025). PL/pgSQL. Retrieved November 24, 2026, from https://encyclopegia.org/wiki/pl-pgsql

Accessed November 24, 2026 · CC BY-SA 4.0 · citation page · JSON

Claims

PredicateValueSource
release date1998-10-30Wikipedia

Related articles

Kandry

stub · references available

Patnikovo

stub · references available

Lutocin

stub · references available

Nanuque

stub · references available

Oliver Bulleid

stub · references available

Ed Stoppard

stub · references available

Olive Wilson

stub · references available

Pchelari

stub · references available

Oliver Hein

stub · references available
CC BY-SA 4.0 · tier1-factual · https://en.wikipedia.org/w/index.php?oldid=1321570456 · 0.55 · snapshot pl-pgsql-240548-b8a813b4f75a65f8 · QID Q2044345

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.