Skip site navigation (1) Skip section navigation (2)

Re: BUG #5268: PQgetvalue incorrectly returns 0

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Mike Landis" <mlandis(at)pnmx(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5268: PQgetvalue incorrectly returns 0
Date: 2010-01-07 13:06:26
Message-ID: 20938.1262869586@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
"Mike Landis" <mlandis(at)pnmx(dot)com> writes:
> When I execute the following SQL:

> "SELECT COUNT(*) FROM information_schema.tables WHERE table_name='proxies'"

> in the PGAdmmin 1.10.0, rev 7945-7946 query tool, I get "1" (the correct
> answer).  When I run the exact same SQL in a C program, I get a result set
> with one tuple and one field (so far so good), but when I run
> PQgetvalue(resultSet,0,0) I get "0" (wrong answer).

The most likely bet I can think of offhand is that your C program
is connecting to the wrong database.

> Am I missing something?  You can't do squat in a client program without
> PQgetvalue().  Is any sort of regression test being run against libpq
> functions?

libpq is exercised probably hundreds of millions of times a day,
every day.

			regards, tom lane

In response to

pgsql-bugs by date

Next:From: Alvaro HerreraDate: 2010-01-07 14:16:11
Subject: Re: email addresses
Previous:From: Mike LandisDate: 2010-01-07 12:51:54
Subject: Re: BUG #5268: PQgetvalue incorrectly returns 0

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group