libpq sendQuery -- getResult not returning until all queries complete

Поиск
Список
Период
Сортировка
От Kelly Burkhart
Тема libpq sendQuery -- getResult not returning until all queries complete
Дата
Msg-id AANLkTik4zFQsB+iZyi-h95qpeBHJ+Qe0kFO9xaHU+A-e@mail.gmail.com
обсуждение исходный текст
Ответы Re: libpq sendQuery -- getResult not returning until all queries complete  (Peter Geoghegan <peter.geoghegan86@gmail.com>)
Список pgsql-general
Hello, I'm sending a group of queries to the database with PQsendQuery
and using PQgetResult to return results similar to this:

PQsendQuery( "select current_timestamp; select pg_sleep(1); select
current_timestamp" );

while( result = PQgetResult() )
    doSomethingWith( result )

I'm finding that PQgetResult() will not return the first result until
all three results are ready.  In real life I would be sending
consequential queries and would like the front end to be processing
one result while the backend is producing the next one.  The
documentation for PQgetResult in section 30.4 of the 8.4.5 manual
suggests that this is what should happen.

Can anyone explain if sendQuery/getResult is intended to work as
documented?  And if so what my problem may be?  (perhaps my pg_sleep
is preventing the first result from being written?)

Thanks,

-Kelly

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

Предыдущее
От: Richard Broersma
Дата:
Сообщение: Re: Constraining overlapping date ranges
Следующее
От: Tomas Vondra
Дата:
Сообщение: Re: Can the query planner create indexes?