From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Thiemo Kellner <thiemo@gelassene-pferde.biz>
To: PostgreSQL General <pgsql-general@lists.postgresql.org>
Subject: Re: dblink: could not send query: another command is already in progress
Date: Fri, 30 Mar 2018 11:14:06 +0200
Message-ID: <1522401246.2396.16.camel@cybertec.at> (raw)
In-Reply-To: <fc1691cf-dde4-f6fd-71f2-a92836a446f5@gelassene-pferde.biz>
References: <8d6c6faa-4878-68bf-d1b7-6b1f86c1445c@gelassene-pferde.biz>
<1522388386.2396.2.camel@cybertec.at>
<fc1691cf-dde4-f6fd-71f2-a92836a446f5@gelassene-pferde.biz>
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 instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: laurenz.albe@cybertec.at, thiemo@gelassene-pferde.biz
Subject: Re: dblink: could not send query: another command is already in progress
In-Reply-To: <1522401246.2396.16.camel@cybertec.at>
References: <8d6c6faa-4878-68bf-d1b7-6b1f86c1445c@gelassene-pferde.biz> <1522388386.2396.2.camel@cybertec.at> <fc1691cf-dde4-f6fd-71f2-a92836a446f5@gelassene-pferde.biz> <1522401246.2396.16.camel@cybertec.at>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox