类似RAISE_APPLICATION_ERROR(-20202,‘xxx’),我看PG是支持的。
do language plpgsql $$ begin raise exception ‘my exception’ using hint = ‘exception hint’, errcode = ‘P9999’; end;
;; ;