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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-interfaces by date

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