Publication date : 02/07/2024

Course : PostgreSQL, PL/pgSQL development

Practical course - 2d - 14h00 - Ref. GVE
Price : 1360 € E.T.

PostgreSQL, PL/pgSQL development




After introducing the basics of the PL/pgSQL language (cursor, record, array, object), this practical course will teach you how to implement stored functions and triggers (their security, rights). You'll also learn how to handle errors and exceptions, particularly in the case of nested transactions.


INTER
IN-HOUSE
CUSTOM

Practical course in person or remote class
Disponible en anglais, à la demande

Ref. GVE
  2d - 14h00
1360 € E.T.




After introducing the basics of the PL/pgSQL language (cursor, record, array, object), this practical course will teach you how to implement stored functions and triggers (their security, rights). You'll also learn how to handle errors and exceptions, particularly in the case of nested transactions.


Teaching objectives
At the end of the training, the participant will be able to:
Understanding transactional processing in PostgreSQL
Master the elements of the PL/pgSQL language
Handling data in a PostgreSQL database
Create stored functions (SQL and PL/pgSQL)
Using different types of triggers
Managing exceptions

Intended audience
Designers, developers and anyone involved in developments using the PostgreSQL database.

Prerequisites
Good knowledge of SQL in a PostgreSQL environment.

Practical details
Hands-on work
Discussions, experience-sharing, demonstrations, tutorials and case studies to train you throughout the course.
Teaching methods
Active pedagogy based on examples, demonstrations, experience sharing, case studies and assessment of learning throughout the course.

Course schedule

1
The fundamentals

  • Transaction processing in PostgreSQL.
  • PostgreSQL database objects and dictionary.
  • SQL and PL/PgSQL. PL/pgSQL overview.
  • Tools and documentation.
Storyboarding workshops

2
Language elements

  • Host environments and syntax introduction.
  • PL/pgSQL variable and constant declarations.
  • Data types, conversion and predefined functions.
  • Control instructions: IF- ELSE, LOOP loop, FOR loop.
  • Composite types: records, tables.
  • Object types.
Hands-on work
Variable declaration, date manipulation, typing attributes and array use.

3
Database access

  • The base and the notion of cursor.
  • Access via implicit cursor: update, delete, insert, select. Use RETURNING clause.
  • FOR cursor loops and cursors in update mode.
  • Explicit cursors, FETCH, MOVE and cursor movement.
  • Using dynamic SQL: EXECUTE ... USING.
  • Use of GET DIAGNOSTICS and runtime information.
Hands-on work
Use of explicit cursors and update cursors.

4
Stored treatments

  • Stored SQL functions.
  • Stored PL/pgSQL functions.
  • Function parameters.
  • Executing stored functions: SELECT versus PERFORM.
  • Using functions in the FROM clause.
  • Volatility of stored functions.
  • PL/pgSQL functions returning the result of a query.
  • Security and rights for stored functions.
Hands-on work
Create stored functions, use different parameter modes and the effect of function volatility.

5
Error management

  • Exception handling.
  • SQLSTATE and sqlerrm variables, error diagnosis.
  • Using RAISE.
  • Error propagation and transactional management.
Hands-on work
Use of RAISE and retrieval of error information.

6
Triggers

  • E/C/A triggers and use of the WHEN clause. Differentiated processing.
  • Event/Action triggers definition and types. Instruction-level triggers.
  • Line-level triggers (use NEW and OLD).
  • Triggers "INSTEAD OF" on views.
  • Atomicity of operations and execution model for triggers.
Hands-on work
Creation of instruction-level triggers and line-level triggers. Execution model for triggers.


Customer reviews
4,1 / 5
Customer reviews are based on end-of-course evaluations. The score is calculated from all evaluations within the past year. Only reviews with a textual comment are displayed.
MORGANE S.
17/07/25
5 / 5

Rich and very clear training with lots of examples. Very good trainer
ERIC S.
17/07/25
5 / 5

Distance learning is always a little more complicated than face-to-face training. The trainer was very competent, but distance learning prevents interaction between listeners.
LEKSIR HAMZA B.
17/07/25
3 / 5

This course has a very academic format, akin to a lecture.



Dates and locations
Select your location or opt for the remote class then choose your date.
Remote class

Dernières places
Date garantie en présentiel ou à distance
Session garantie

REMOTE CLASS
2026 : 23 Mar., 22 June, 5 Oct., 19 Nov.

PARIS LA DÉFENSE
2026 : 23 Mar., 22 June, 5 Oct., 19 Nov.