抛出并捕获自定义EXCEPTION
atlasdb=# DO $$ DECLARE
ex_custom information_schema.EXCEPTION;
ex_custom1 information_schema.EXCEPTION;
BEGIN
RAISE ex_custom;
EXCEPTION
WHEN ex_custom THEN
raise INFO '1';
WHEN ex_custom1 THEN
raise INFO '2';
END $$ ;
INFO: 1
DO