X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 4374FD7117 for ; Wed, 12 Oct 2005 21:17:11 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 20000-08 for ; Thu, 13 Oct 2005 00:17:05 +0000 (GMT) Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.195]) by svr1.postgresql.org (Postfix) with ESMTP id E8DADD81A1 for ; Wed, 12 Oct 2005 21:17:06 -0300 (ADT) Received: by zproxy.gmail.com with SMTP id 40so257655nzk for ; Wed, 12 Oct 2005 17:17:11 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=VOtqBtb/5+4AFPBMBC3N2J8afkzIlXsS0iOgaPvelnhLY070ZO408APanrop9MDeGZkvWi3X6Hid9mPAWv0YKqkOsLAH4hDNeLymojb92G67H39gDzvhTdMnGTXjzoHsHpOfxtlfL9phgT/QS1IlD1cAoHc4jIfAVWQGpHOmkD0= Received: by 10.36.47.8 with SMTP id u8mr1422627nzu; Wed, 12 Oct 2005 17:17:10 -0700 (PDT) Received: by 10.36.120.19 with HTTP; Wed, 12 Oct 2005 17:17:10 -0700 (PDT) Message-ID: <6619c3340510121717h22b0ead5j24749719d7bc9d90@mail.gmail.com> Date: Wed, 12 Oct 2005 20:17:10 -0400 From: Fangbing Wu To: Michael Fuhr Subject: Re: How do I get more error codes from libpq Cc: pgsql-interfaces@postgresql.org In-Reply-To: <6619c3340510121712r3c32f47dicd50ec82d065da4@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_34455_9747169.1129162630921" References: <6619c3340510111959o770e3b1m3a493480068411d9@mail.gmail.com> <20051012031428.GA27278@winnie.fuhr.org> <6619c3340510121712r3c32f47dicd50ec82d065da4@mail.gmail.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.221 required=5 tests=[AWL=0.110, HTML_40_50=0.086, HTML_MESSAGE=0.001, RCVD_BY_IP=0.024] X-Spam-Level: X-Archive-Number: 200510/12 X-Sequence-Number: 5774 ------=_Part_34455_9747169.1129162630921 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline With more reading, I think I got what I was after. The routine char *PQresultErrorField(const PGresult *res, int fieldcode); gives me what I want. Thanks! Fangbing On 10/12/05, Fangbing Wu wrote: > > Yeah, > > I'm still in the process of reading more of the doc. But my question is > more like > when I get something like PGRES_BAD_RESPONSE or PGRES_NONFATAL_ERROR, how > would > I go about to find out what's the cause of such an error? > Could it be due to access right problems or some other transient > conditions? > Is there a way to get those info.? > > Thanks! > Fangbing > > > On 10/11/05, Michael Fuhr wrote: > > > > On Tue, Oct 11, 2005 at 10:59:19PM -0400, Fangbing Wu wrote: > > > I'm just getting started to use libpq to access my DB with > > > PQexecParam etc. > > > I'm still searching for ways to get detailed error codes from libpq, > > > say when a request was denied due to permission etc. > > > Is stuff like this possible? > > > > Yes, just read a little farther down the "Command Execution Functions" > > documentation: > > > > http://www.postgresql.org/docs/8.0/interactive/libpq-exec.html > > > > -- > > Michael Fuhr > > > > ------=_Part_34455_9747169.1129162630921 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline With more reading, I think I got what I was after. The routine
char *PQresultErrorField(const PGresult *res, int f=
ieldcode);

giv= es me what I want.

Thanks!
Fangbing

On 10/12/05, Fangbing Wu <fangbingw@gmail.com> wrote:
Yeah,

I'm still in the process of reading more of the doc. But my question is mor= e like
when I get something like PGRES_BAD_RESPONSE or PGRES_NONFATAL= _ERROR, how would
I go about to find out what's the cause of such an error?
Could it be due to access right problems or some other transient condi= tions?
Is there a way to get those info.?

Thanks!
Fangbing

------=_Part_34455_9747169.1129162630921--