Skip site navigation (1) Skip section navigation (2)

Re: Reg : Error Handling

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: sandhya <sandhyar(at)amiindia(dot)co(dot)in>
Cc: postgre <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Reg : Error Handling
Date: 2005-10-20 06:18:26
Message-ID: 20051020061825.GA71430@winnie.fuhr.org (view raw or flat)
Thread:
Lists: pgsql-admin
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

In response to

pgsql-admin by date

Next:From: Peter EisentrautDate: 2005-10-20 08:58:20
Subject: Re: Possible bug in pgAdmin III v1.2.2
Previous:From: sandhyaDate: 2005-10-20 05:00:36
Subject: Re: Reg : Error Handling

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group