Unable to open large object. - Mailing list pgsql-novice

From Yuichi Tanaka
Subject Unable to open large object.
Date
Msg-id 0_58750200_1235695357.31027.cbgrn@enoch.corp.cybozu.co.jp
Whole thread Raw
Responses Re: Unable to open large object.
List pgsql-novice
Hi, all.
Sorry if you have received same mail in pgsql-bugs mailing list.

I wrote C code with libpq using PQsendQuery and lo_open.
In some situation, I cannot open large object.

The situation is following:
1. Open some large object file (using lo_open).
   -> succeed
2. Send query asynchronously (using PQsendQuery).
   -> succeed
3. Get query result (using PQgetResult).
   -> succeed
4. Open another large object file (using pg_lo_open).
   -> fail

As a result, second large object lo_open (No.4) returns false.

But if I execute PQgetResult twice, I can open both large objects.
1. Open some large object file (using lo_open).
   -> succeed.
2. Send query asynchronously (using PQsendQuery).
   -> succeed.
3. Get query result (using PQgetResult).
   -> succeed.
4. Get query result (using PQgetResult).
   -> Returns NULL.
5. Open another large object file (using pg_lo_open).
   -> succeed.

Do I always have to call PQgetResult until this function returns NULL pointer?

----
Yuichi Tanaka (yuichi_tanaka@cybozu.co.jp)

pgsql-novice by date:

Previous
From: Tom Lane
Date:
Subject: Re: pl/pgsql short circuit evaluation?
Next
From: Tom Lane
Date:
Subject: Re: Unable to open large object.