Re: libpq: how to get error code (not message) - Mailing list pgsql-interfaces

From Michael Fuhr
Subject Re: libpq: how to get error code (not message)
Date
Msg-id 20041202060648.GA60984@winnie.fuhr.org
Whole thread Raw
In response to libpq: how to get error code (not message)  (X X <junkmbox@yahoo.com>)
List pgsql-interfaces
On Wed, Dec 01, 2004 at 07:11:44PM -0800, X X wrote:

> I would like to know what function to call to obtain
> one of the codes listed at 
> 
> http://www.postgresql.org/docs/7.4/static/errcodes-appendix.html

I think you're looking for PQresultErrorField() called with the
fieldcode argument set to PG_DIAG_SQLSTATE.

-- 
Michael Fuhr
http://www.fuhr.org/~mfuhr/


pgsql-interfaces by date:

Previous
From: X X
Date:
Subject: libpq: how to get error code (not message)
Next
From: Michael Fuhr
Date:
Subject: Re: libpq: how to get error code (not message)