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.