Re: Column info without executing query

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: Column info without executing query
Дата
Msg-id 20060721142521.GD21076@svana.org
обсуждение исходный текст
Ответ на Re: Column info without executing query  (Volkan YAZICI <yazicivo@ttnet.net.tr>)
Ответы Re: Column info without executing query  (<Mitch.Logue@tdameritrade.com>)
Re: Column info without executing query  (Volkan YAZICI <yazicivo@ttnet.net.tr>)
Список 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.

Вложения

В списке pgsql-general по дате отправления:

Предыдущее
От: Claire McLister
Дата:
Сообщение: Re: Create index hanging
Следующее
От:
Дата:
Сообщение: Re: Column info without executing query