Exceptions
A PL/pgSQL block can catch an error with an EXCEPTION section. The block's changes are rolled back to the start of the block when it catches.
task
Write safe_div(a int, b int) that returns NULL on division by zero.
Run a query to see rows here.
Run EXPLAIN on the statement under the cursor: Plan tab, button Explain.
No tables yet.
A PL/pgSQL block can catch an error with an EXCEPTION section. The block's changes are rolled back to the start of the block when it catches.
Write safe_div(a int, b int) that returns NULL on division by zero.