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

Reply via email to