Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
Syntax of PL/pgSQL
Function parameters
Handling exceptions
23. Raising exceptions – example
Summary

Instruction

Good job! Before we finish this part, there's one more topic we're going to discuss: exceptions. Exceptions are used in code to signal exceptional conditions: errors or anomalies.

For example, a function can check if its arguments are valid. If the arguments are invalid (for instance, an id refers to a non-existent object), the function can signal this with an exception.

Exercise

Run the template query and see what the EXCEPTION looks like.