pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Fuhr <mike@fuhr.org>
To: sandhya <sandhyar@amiindia.co.in>
Cc: postgre <pgsql-admin@postgresql.org>
Subject: Re: Reg : Error Handling
Date: Thu, 20 Oct 2005 00:18:26 -0600
Message-ID: <20051020061825.GA71430@winnie.fuhr.org> (raw)
In-Reply-To: <00b401c5d537$9503a9d0$cd00000a@amiindiahjwbgh>
References: <057401c5d497$a25e81e0$cd00000a@amiindiahjwbgh>
	<20051019172507.GA72974@winnie.fuhr.org>
	<00b401c5d537$9503a9d0$cd00000a@amiindiahjwbgh>

On Thu, Oct 20, 2005 at 10:30:36AM +0530, sandhya wrote:
> I am able to get the error code as a return value from the function using,
> return (PQresultErrorField(res,PG_DIAG_SQLSTATE));
> Problem is i don't know how to generalize the messages once i get
> this....Pls any one help me in this regard

The "PostgreSQL Error Codes" appendix to the documentation explains
what each SQLSTATE code means:

http://www.postgresql.org/docs/8.0/interactive/errcodes-appendix.html

See also server/utils/errcodes.h.  I haven't found anywhere in the
source code that provides mappings from SQLSTATE to generic messages,
so you'll probably have to do that yourself.

-- 
Michael Fuhr



view thread (4+ messages)

Message-ID: <20051020061825.GA71430@winnie.fuhr.org>
Permalink:  ../20051020061825.GA71430@winnie.fuhr.org/
Also on:    postgresql.org/message-id/20051020061825.GA71430@winnie.fuhr.org

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: mike@fuhr.org, sandhyar@amiindia.co.in
  Subject: Re: Reg : Error Handling
  In-Reply-To: <20051020061825.GA71430@winnie.fuhr.org>
  References: <057401c5d497$a25e81e0$cd00000a@amiindiahjwbgh> <20051019172507.GA72974@winnie.fuhr.org> <00b401c5d537$9503a9d0$cd00000a@amiindiahjwbgh> <20051020061825.GA71430@winnie.fuhr.org>

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

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