EXCEPTION
Description
When an exception occurs, and you add an exception-handling block, you can write RAISE statements and most other PL/pgSQL statements. For example, you can raise an exception with a custom message or insert a record into a logging table.
Grammar Syntax
EXCEPTION
WHEN OTHERS THEN
statementsSample Source Patterns
Input Code:
CREATE OR REPLACE PROCEDURE update_employee_sp() AS
$$
BEGIN
select var;
EXCEPTION WHEN OTHERS THEN
RAISE INFO 'An exception occurred.';
END;
$$
LANGUAGE plpgsql;Output Code:
Known Issues
There are no known issues.
Related EWIs.
There are no related EWIs.
Last updated
