Re: Column info without executing query - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: Column info without executing query
Date
Msg-id 20060721142521.GD21076@svana.org
Whole thread Raw
In response to Re: Column info without executing query  (Volkan YAZICI <yazicivo@ttnet.net.tr>)
Responses Re: Column info without executing query  (<Mitch.Logue@tdameritrade.com>)
Re: Column info without executing query  (Volkan YAZICI <yazicivo@ttnet.net.tr>)
List 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@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Attachment

pgsql-general by date:

Previous
From: Claire McLister
Date:
Subject: Re: Create index hanging
Next
From:
Date:
Subject: Re: Column info without executing query