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

Re: libpq: how to get error code (not message)

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: X X <junkmbox(at)yahoo(dot)com>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: libpq: how to get error code (not message)
Date: 2004-12-02 06:06:48
Message-ID: 20041202060648.GA60984@winnie.fuhr.org (view raw or flat)
Thread:
Lists: 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/

In response to

Responses

pgsql-interfaces by date

Next:From: Michael FuhrDate: 2004-12-03 01:41:15
Subject: Re: libpq: how to get error code (not message)
Previous:From: X XDate: 2004-12-02 03:11:44
Subject: libpq: how to get error code (not message)

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