Re: [GENERAL] PQgetvalue weirdness - Mailing list pgsql-general

From Simon Drabble
Subject Re: [GENERAL] PQgetvalue weirdness
Date
Msg-id Pine.LNX.3.95.980910144035.17858A-100000@fiddletrudge.dyn.ml.org
Whole thread Raw
In response to Re: [GENERAL] PQgetvalue weirdness  (Chris Johnson <cmj@inline-design.com>)
List pgsql-general

On Thu, 10 Sep 1998, Chris Johnson wrote:

> Postgres numbers the rows and fields starting at 0 - your call to get the
> first row and column would be PQgetvalue(result, 0, 0)
>
> Chris

Thanks for your reply, but..

If I have a zero for the field number (last parameter) I get a seg fault
immediately - gdb shows it to be in PQgetvalue().

If I have a row number of zero (second param) I get the same error as
below (if the column number is >0 )


Simon.




>
> On Thu, 10 Sep 1998, Simon Drabble wrote:
>
> >
> > I'm executing a (simple) query using libpq, and this is the error I get
> > from PQgetvalue(result, 1, 1):
> >
> > PQgetvalue: There is no field 1 in the query results.  The highest
> > numbered field is 0.
> >
> > I get a similar error if I call getlength().
> >
> > There _is_ data there - PQprintTuples() prints everything correctly.
> >
> >
> > Can anyone shed any light?  PQtrace() doesn't reveal anything useful..
> >
> >
> > Simon.
> >
> >
> > --
> >                            ...oooOOOooo...
> >    Simon Drabble                     mailto:madlather@syspac.com
> >    http://fiddletrudge.dyn.ml.org/
> >    KreatAPayj           --        ~simon/KreatAPayj/login.html
> >    LizardCam            --        LizardCam/LizardCam.html
> >    Linux Knowledge Base --        ~simon/LinuxKB/index.html
> >
> >
> >
>

--
                           ...oooOOOooo...
   Simon Drabble                     mailto:madlather@syspac.com
   http://fiddletrudge.dyn.ml.org/
   KreatAPayj           --        ~simon/KreatAPayj/login.html
   LizardCam            --        LizardCam/LizardCam.html
   Linux Knowledge Base --        ~simon/LinuxKB/index.html



pgsql-general by date:

Previous
From: Chris Johnson
Date:
Subject: Re: [GENERAL] PQgetvalue weirdness
Next
From: Chris Johnson
Date:
Subject: Re: [GENERAL] PQgetvalue weirdness