PL/pgSQL: PostgreSQL's procedural language

During the development and/or control of programs for database processing, application programmers, developers and DBAs need more than the basic relational possibilities of SQL in a PostgreSQL database.

Therefore the objectives of this course are:

  • to describe and exercise the procedural characteristics that are added by PL/SQL to SQL;
  • to know the advantages of using stored procedures, functions and triggers.


No public sessions are currently scheduled. We will be pleased to set up an on-site course or to schedule an extra public session (in case of a sufficient number of candidates). Interested? Please let us know.

Intended for

This course is designed for application programmers, developers and DBAs.


Knowledge of PostgreSQL relational database systems, SQL and the concepts behind procedural languages.

Main topics

  • Introduction PL/SQL:

'Inline' versus 'Stored' procedures

  • SQL support:

Writing SQL in a procedural environment

  • Variables and constants - records, collections:

Explicit declaration • implicit declaration

  • Logical comparisons:

If-then-else structure

  • Conditional and iterative control:

For-loop • do-while loop • loop-endloop • goto

  • Cursor management:

Implicit and explicit cursors • attributes • cursor-for loop

  • Error treatment:

Pre-defined exceptions • application exceptions

  • Procedural objects:

functions • stored procedures • triggers

Training method

Classroom instruction with practical exercises.


2 days.

Course leader

Kris Van Thillo, Peter Vanroose.