PL/pgSQL Control Structures
Always right. Misinformed, perhaps. Sloppy, crude, bullheaded, fickle, even stupid, but never wrong.
PL/pgSQL is a language that allows developers to write stored procedures and functions in a procedural manner (instead of writing them in the declarative fashion of SQL) whilst still providing the speed benefits of the SQL language. This allows the developer to easily move complex business logic from the (often slow) application layer to the (usually faster) database layer, which provides a number of benefits. Various control structures exist which can be used to write PL/pgSQL functions that can perform this type of logic.
In this talk, a brief overview will be given about some of the other languages that one can use to write stored procedures and functions, with the main focus being on PL/pgSQL. Each control structure that is available in the PL/pgSQL language is then going to be explained along with a corresponding example. These will include each of the conditional structures, looping structures, return statements (including RETURN NEXT and RETURN QUERY), and error handling.
At the end of this session, attendees can expect to have sufficient knowledge about the usage of the different control structures in order to write, extend or improve stored procedures and functions in their database systems.
- 2019 October 8 15:00
- 40 min
- South Africa 2019