Is there a way to get information on an exception inside an exception block?
I’ve looked on the net and saw some postings regarding a patch for 8.0 that may or may not be integrated into the main release at this point.
I’m currently running 8.0.3, writing a function using the plpgsql language and have tried several options, albeit unsuccessfully.
I want to enable something like the following:
BEGIN
[ STATEMENT THAT THROWS AN EXCEPTION]
EXCEPTION WHEN OTHERS THEN
RAISE NOTICE ‘exception (code=%): %’, SQLCODE, SQLERRM;
[ DO SOMETHING ELSE]
END;
Thanks,
Lance