Обсуждение: Text Description of Current Exception

Поиск
Список
Период
Сортировка

Text Description of Current Exception

От
"Ward Eaton"
Дата:

Hello,

 

I would like to log any exceptions which may be thrown in my database functions.  Oracle has a predefined variable, SQLERRM, which will always have a text description of the current exception.  Is there anything like this available in postgres?

 

Thank you,

Ward Eaton
Project Engineer Automation

RAD-CON Inc.
TECHNOLOGY:
Innovative & Proven
Office: +1.216.706.8927
Fax: +1.216.221.1135
Website: www.RAD-CON.com
E-mail: Ward.Eaton@RAD-CON.com

 

Вложения

Re: Text Description of Current Exception

От
Justin
Дата:
Ward Eaton wrote:

Hello,

 

I would like to log any exceptions which may be thrown in my database functions.  Oracle has a predefined variable, SQLERRM, which will always have a text description of the current exception.  Is there anything like this available in postgres?

 



I'm not sure what you are after.  Your requesting logging the error yet referring to SqlErrm used in exception blocks

postgresql has SQLSTATE used in  exception catching of errors in a pl/SQL function  see
http://www.postgresql.org/docs/8.3/interactive/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING

Postgresql logs errors in a log file unless it's been turned off.
See configure logging
http://www.postgresql.org/docs/8.3/interactive/runtime-config-logging.html


These instructions are for 8.3  if you have different version go to this section of the help files for your specific version.