Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f1q72-0006oA-Gg for pgsql-general@arkaria.postgresql.org; Fri, 30 Mar 2018 09:14:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f1q70-0002uS-T8 for pgsql-general@arkaria.postgresql.org; Fri, 30 Mar 2018 09:14:18 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f1q70-0002uI-H2 for pgsql-general@lists.postgresql.org; Fri, 30 Mar 2018 09:14:18 +0000 Received: from mx2.mailbox.org ([80.241.60.215]) by makus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1f1q6v-0007lR-W2 for pgsql-general@lists.postgresql.org; Fri, 30 Mar 2018 09:14:17 +0000 Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx2.mailbox.org (Postfix) with ESMTPS id 1525A41759; Fri, 30 Mar 2018 11:14:09 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter01.heinlein-hosting.de (spamfilter01.heinlein-hosting.de [80.241.56.115]) (amavisd-new, port 10030) with ESMTP id n0inJ3Vuy--3; Fri, 30 Mar 2018 11:14:08 +0200 (CEST) Message-ID: <1522401246.2396.16.camel@cybertec.at> Subject: Re: dblink: could not send query: another command is already in progress From: Laurenz Albe To: Thiemo Kellner , PostgreSQL General Date: Fri, 30 Mar 2018 11:14:06 +0200 In-Reply-To: References: <8d6c6faa-4878-68bf-d1b7-6b1f86c1445c@gelassene-pferde.biz> <1522388386.2396.2.camel@cybertec.at> Organization: Cybertec Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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