pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Craig Brozefsky <craig@red-bean.com>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: issues with libpg interface
Date: Wed, 17 Jan 2001 20:55:28 -0500
Message-ID: <22568.979782928@sss.pgh.pa.us> (raw)
In-Reply-To: <87itndwy8n.fsf@piracy.red-bean.com>
References: <87itndwy8n.fsf@piracy.red-bean.com>

Craig Brozefsky <craig@red-bean.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



view thread (3+ messages)  latest in thread

Message-ID: <22568.979782928@sss.pgh.pa.us>
Permalink:  ../22568.979782928@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/22568.979782928@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: tgl@sss.pgh.pa.us, craig@red-bean.com
  Subject: Re: issues with libpg interface
  In-Reply-To: <22568.979782928@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox