Skip to content

PL/pgSQL

  • PL/pgSQL is a procedural programming language for the PostgreSQL database system.

  • PL/pgSQL allows you to extend the functionality of the PostgreSQL database server by creating server objects with complex logic.

  • PL/pgSQL was designed to :

  • Create user-defined functions, stored procedures, and triggers.

  • Extend standard SQL by adding control structures such as if, case, and loop statements.
  • Inherit all user-defined functions, operators, and types.

  • PL/pgSQL wraps multiple statements in an object and store it on the PostgreSQL database server.

  • Instead of sending multiple statements to the server one by one, you can send one statement to execute the object stored in the server.