pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Fuhr <mike@fuhr.org>
To: X X <junkmbox@yahoo.com>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: libpq: how to get error code (not message)
Date: Wed, 1 Dec 2004 23:06:48 -0700
Message-ID: <20041202060648.GA60984@winnie.fuhr.org> (raw)
In-Reply-To: <20041202031144.68001.qmail@web51106.mail.yahoo.com>
References: <20041202031144.68001.qmail@web51106.mail.yahoo.com>

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/



view thread (3+ messages)  latest in thread

Message-ID: <20041202060648.GA60984@winnie.fuhr.org>
Permalink:  ../20041202060648.GA60984@winnie.fuhr.org/
Also on:    postgresql.org/message-id/20041202060648.GA60984@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 using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: mike@fuhr.org, junkmbox@yahoo.com
  Subject: Re: libpq: how to get error code (not message)
  In-Reply-To: <20041202060648.GA60984@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