Re: issues with libpg interface

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Craig Brozefsky <craig(at)red-bean(dot)com>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: issues with libpg interface
Date: 2001-01-18 01:55:28
Message-ID: 22568.979782928@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

Craig Brozefsky <craig(at)red-bean(dot)com> writes:
> We have two situations that have arisen while using libpq thru CMUCL
> bindings in our UncommonSQL package. We have a multi-processing
> application which uses a pool of database connections to perform DB
> queries.

> The first one is that we are getting unexpected retun values from
> pgresultstatus after calling pgexec, a value of PGRES_TUPLES_OK. The
> thing is that we're not sending a SELECT, just UPDATES, INSERTS and
> DELETES. My understanding is that none of those return tuples.

They don't. I think you must have some kind of multithreading bug
on the client side (whether it's in libpq or your code is hard to say).
A quick look at libpq's source shows that it can only generate
PGRES_TUPLES_OK after seeing a 'T' (row descriptor) message from the
backend, and the backend will surely not send such a thing except for
SELECT or FETCH.

> Also, unrelated, I think, to the above issue, we are getting the
> following message intermittently:
> Backend message type 0x50 arrived while idle

That would be a 'P' (CursorResponse) message, which is a normal (if
not very useful) part of the query cycle. Something's definitely
out of sync in the frontend/backend protocol, it seems. You might
find it helpful to read
http://www.postgresql.org/devel-corner/docs/postgres/protocol.htm

regards, tom lane

In response to

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message The Hermit Hacker 2001-01-18 03:25:44 [RFC] Proposed split of -interfaces list ...
Previous Message Craig Brozefsky 2001-01-17 23:32:56 issues with libpg interface