Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
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

> 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

			regards, tom lane

In response to


pgsql-interfaces by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group