Getting exception information (SQLERRM, SQLSTATE, etc.)
От
Lance Arlaus
Тема
Getting exception information (SQLERRM, SQLSTATE, etc.)
Дата
Msg-id
008601c59d37$ed9c4210$6401a8c0@LanceLaptop
Список
Дерево обсуждения
Getting exception information (SQLERRM, SQLSTATE, etc.) "Lance Arlaus" <lance.nospam.1@codeberet.com>
Re: Getting exception information (SQLERRM, SQLSTATE, etc.) Tom Lane <tgl@sss.pgh.pa.us>
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
В списке pgsql-novice по дате отправления