Received: from sss.pgh.pa.us (sss.pgh.pa.us [209.114.132.154]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f0I1th086923 for ; Wed, 17 Jan 2001 20:55:43 -0500 (EST) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.1/8.11.1) with ESMTP id f0I1tSJ22571; Wed, 17 Jan 2001 20:55:28 -0500 (EST) To: Craig Brozefsky cc: pgsql-interfaces@postgresql.org Subject: Re: issues with libpg interface In-reply-to: <87itndwy8n.fsf@piracy.red-bean.com> References: <87itndwy8n.fsf@piracy.red-bean.com> Comments: In-reply-to Craig Brozefsky message dated "17 Jan 2001 18:32:56 -0500" Date: Wed, 17 Jan 2001 20:55:28 -0500 Message-ID: <22568.979782928@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200101/182 X-Sequence-Number: 800 Craig Brozefsky 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