[BUG?] strange PQgetisnull - Mailing list pgsql-hackers

From Park, Chul-Su
Subject [BUG?] strange PQgetisnull
Date
Msg-id 35ADB583.4FFBE4CD@mhlx01.kek.jp
Whole thread Raw
Responses Re: [HACKERS] [BUG?] strange PQgetisnull  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: [HACKERS] [BUG?] strange PQgetisnull  (Bruce Momjian <maillist@candle.pha.pa.us>)
List pgsql-hackers
Hi all,

    I got strange result with PQgetisnull, say

for empty table(I think that it's empty so null)

I guess that
after fetch some selection
PQgetisnull(result, 0, 0) should give me "1 or true"
But
it gives me
ERROR! field 0(of 0) of row 0(of 0) is not available... Segmentation
Fault

so I tried
if (PQntuples(result) == 0)
...

But  PQntules gives me "1" not "0" !

do I have to check result with
char* value = PQgetvalue(result, 0, 0);
and test value is "" or not?  any idea???

I'm using v6.3.2 on linux && Solaris.

Best Regards, C.S.Park


pgsql-hackers by date:

Previous
From: Maarten Boekhold
Date:
Subject: Re: [INTERFACES] Re: [HACKERS] changes in 6.4
Next
From: Hannu Krosing
Date:
Subject: Re: [INTERFACES] Re: [HACKERS] changes in 6.4