agora inbox for pgsql-sql@postgresql.org  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Roopeshakumar Narayansa Shalgar (rshalgar) <rshalgar@cisco.com>
Cc: pgsql-sql@postgresql.org <pgsql-sql@postgresql.org>
Cc: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Subject: Re: [GENERAL] Any postgres API available to get errorcode for PQerrorMessage
Date: Wed, 15 Oct 2014 12:36:35 -0400
Message-ID: <4478.1413390995@sss.pgh.pa.us> (raw)
In-Reply-To: <F9567754259D974D88F5F5337C9D219620BD0C43@xmb-aln-x11.cisco.com>
References: <F9567754259D974D88F5F5337C9D219620BD0C43@xmb-aln-x11.cisco.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-sql>

"Roopeshakumar Narayansa Shalgar (rshalgar)" <rshalgar@cisco.com> writes:
> 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

Use PQresultErrorField(..., PG_DIAG_SQLSTATE)

http://www.postgresql.org/docs/9.3/static/libpq-exec.html#LIBPQ-EXEC-MAIN

			regards, tom lane


-- 
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql



view thread (8+ messages)  latest in thread

Message-ID: <4478.1413390995@sss.pgh.pa.us>
Permalink:  ../4478.1413390995@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/4478.1413390995@sss.pgh.pa.us

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, rshalgar@cisco.com, pgsql-general@postgresql.org
  Subject: Re: [GENERAL] Any postgres API available to get errorcode for PQerrorMessage
  In-Reply-To: <4478.1413390995@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox