pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
How do I get more error codes from libpq
4+ messages / 2 participants
[nested] [flat]

* How do I get more error codes from libpq
@ 2005-10-12 02:59  Fangbing Wu <fangbingw@gmail.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Fangbing Wu @ 2005-10-12 02:59 UTC (permalink / raw)
  To: pgsql-interfaces

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?

Thanks!
FBW

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: How do I get more error codes from libpq
@ 2005-10-12 03:14  Michael Fuhr <mike@fuhr.org>
  parent: Fangbing Wu <fangbingw@gmail.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Michael Fuhr @ 2005-10-12 03:14 UTC (permalink / raw)
  To: Fangbing Wu <fangbingw@gmail.com>; +Cc: pgsql-interfaces

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



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: How do I get more error codes from libpq
@ 2005-10-13 00:12  Fangbing Wu <fangbingw@gmail.com>
  parent: Michael Fuhr <mike@fuhr.org>
  0 siblings, 1 reply; 4+ messages in thread

From: Fangbing Wu @ 2005-10-13 00:12 UTC (permalink / raw)
  To: Michael Fuhr <mike@fuhr.org>; +Cc: pgsql-interfaces

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 <mike@fuhr.org> 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
>

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: How do I get more error codes from libpq
@ 2005-10-13 00:17  Fangbing Wu <fangbingw@gmail.com>
  parent: Fangbing Wu <fangbingw@gmail.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Fangbing Wu @ 2005-10-13 00:17 UTC (permalink / raw)
  To: Michael Fuhr <mike@fuhr.org>; +Cc: pgsql-interfaces

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 <fangbingw@gmail.com> 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 <mike@fuhr.org> 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
> >
>
>

^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2005-10-13 00:17 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-10-12 02:59 How do I get more error codes from libpq Fangbing Wu <fangbingw@gmail.com>
2005-10-12 03:14 ` Michael Fuhr <mike@fuhr.org>
2005-10-13 00:12   ` Fangbing Wu <fangbingw@gmail.com>
2005-10-13 00:17     ` Fangbing Wu <fangbingw@gmail.com>

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