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

Поиск
Список
Период
Сортировка
От Thiemo Kellner
Тема Re: dblink: could not send query: another command is already inprogress
Дата
Msg-id fc1691cf-dde4-f6fd-71f2-a92836a446f5@gelassene-pferde.biz
обсуждение исходный текст
Ответ на Re: dblink: could not send query: another command is already inprogress  (Laurenz Albe <laurenz.albe@cybertec.at>)
Ответы Re: dblink: could not send query: another command is already inprogress
Список pgsql-general
On 03/30/18 07:39, Laurenz Albe wrote:
>> psql:testing/test.pg_sql:41: NOTICE:  Connection busy: 1
>>
>> psql:testing/test.pg_sql:41: NOTICE:  Last error: OK
>>
>> psql:testing/test.pg_sql:41: NOTICE:  Cancel query: OK
>>
>> psql:testing/test.pg_sql:41: NOTICE:  Connection busy: 0
>>
>> psql:testing/test.pg_sql:41: NOTICE:  could not send query: another
>> command is already in progress
> 
>> Has anyone an idea?
> 
> The cause of the error message is clear; as the documentation says:

Not to me. As mentioned in my first post, originally I did no cancelling 
and error checking and had the same error. Trying to cancelling did not 
alter behaviour. It boils down to: Why do I get the "another command is 
already in progress" when dblink_is_busy acknowledges the dblink to not 
be busy by returning 0?

>    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.

I hope I can check on that today and get back with my findings.

-- 
SIP/iptel.org: thiemo.kellner
Öffentlicher PGP-Schlüssel:
http://pgp.mit.edu/pks/lookup?op=get&search=0xCA167FB0E717AFFC

Вложения

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

Предыдущее
От: Laurenz Albe
Дата:
Сообщение: Re: Asynchronous Trigger?
Следующее
От: Laurenz Albe
Дата:
Сообщение: Re: dblink: could not send query: another command is already inprogress