Any postgres API available to get errorcode for PQerrorMessage

From: "Roopeshakumar Narayansa Shalgar (rshalgar)" <rshalgar(at)cisco(dot)com>
To: "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Any postgres API available to get errorcode for PQerrorMessage
Date: 2014-10-15 08:17:01
Message-ID: F9567754259D974D88F5F5337C9D219620BD0C43@xmb-aln-x11.cisco.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql

HI,

PQerrorMessage pirints the error message like (no space available,etc). Does postgres provide
any API which gives the error code listed in the below appendix;

http://www.postgresql.org/docs/9.1/static/errcodes-appendix.html

I need the exact error code so that I can shutdown my application whenever I face the "no space available" problem.

--
Thanks and Regards,
Rupesh

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Albe Laurenz 2014-10-15 08:35:18 Re: copying a large database to change encoding
Previous Message Abelard Hoffman 2014-10-15 02:33:46 Will pg_repack improve this query performance?

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2014-10-15 16:36:35 Re: [GENERAL] Any postgres API available to get errorcode for PQerrorMessage
Previous Message Alvaro Herrera 2014-10-10 16:26:24 Re: could not access status of transaction pg_multixact issue