Re: Column info without executing query

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Volkan YAZICI <yazicivo(at)ttnet(dot)net(dot)tr>
Cc: Jacob Coby <jcoby(at)listingbook(dot)com>, Dan Strömberg <dan(dot)stromberg(at)stockholm(dot)bonet(dot)se>, pgsql-general(at)postgresql(dot)org
Subject: Re: Column info without executing query
Date: 2006-07-21 14:25:21
Message-ID: 20060721142521.GD21076@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Jul 21, 2006 at 05:07:08PM +0300, Volkan YAZICI wrote:
> AFAICS, that's not possible with current parsing capabilities. See
> related lines in
>
> fe-protocol3.c:pqParseInput3()
> 102 /*
> 103 * Can't process if message body isn't all here yet.
> 104 */
>
> But, IMNSHO, we can modify parsing functionality to process message
> parts step by step. For instance, in the current behaviour when we
> receive a T, D, D, ... message, libpq won't attempt to process data
> until it receives whole data chunk. But with some modification on the
> parser side, we can make it process data in such a way:

Actually, you're wrong. It processes the T as it comes in, and then
each D as it comes in. "message body" in this case refers to a single
'T' or 'D' record, not the entire query result.

> But in this case, some advanced function routines must be written to
> access conn->result in a hardcoded way under strict control. Because,
> PQgetReesult() won't work properly till it receives whole result set.

Did you see my comment about get partial result sets from libpq. for
asyncronous queries you can run PQftype as soon as you've received and
parsed the T record, you don't actually have to have received any data
yet... See pqPrepareAsyncResult().

Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Volkan YAZICI 2006-07-21 14:47:32 Re: Column info without executing query
Previous Message Claire McLister 2006-07-21 14:19:16 Re: Create index hanging