Re: dblink: could not send query: another command is already inprogress

Поиск
Список
Период
Сортировка
От Laurenz Albe
Тема Re: dblink: could not send query: another command is already inprogress
Дата
Msg-id 1522401246.2396.16.camel@cybertec.at
обсуждение исходный текст
Ответ на Re: dblink: could not send query: another command is already inprogress  (Thiemo Kellner <thiemo@gelassene-pferde.biz>)
Ответы Re: dblink: could not send query: another command is already inprogress
Список pgsql-general
Thiemo Kellner wrote:
> The cause of the error message is clear; as the documentation says:
> 
> >    the query will fail soon. You must still complete the normal query protocol,
> >    for example by calling dblink_get_result.
> 
> Ah, maybe this is the underlying problem. If dblink requires that 
> results get retrieved by dblink_get_result before the dblink is actually 
> ready to receive another query, it would explain the error I get. 
> However, I feel than the result of dblink_is_busy is faulty, 
> counter-intuitive or just useless in that context. Or I just 
> misinterpreted documentation: "checks if connection is busy with an 
> async query"
> 
> My understand there is that the actual query is still being processed, 
> the gathering of the results. I did not count the keeping of the result 
> as part of the query.

That is a misunderstanding.

If the connection is "busy", that means that the asynchronous query
is still busy receiving a result from the server.

Once it is no longer busy, a result has arrived and is ready to be
consumed.

You have to consume the result before you can send the next query.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com


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

Предыдущее
От: Thiemo Kellner
Дата:
Сообщение: Re: dblink: could not send query: another command is already inprogress
Следующее
От: Achilleas Mantzios
Дата:
Сообщение: Re: Question about buffers_alloc in pg_stat_bgwriter view formonitoring