Re: consequent PQsendQueryPrepared() failed: another command is already in progress

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: consequent PQsendQueryPrepared() failed: another command is already in progress
Дата
Msg-id 6768.1276699160@sss.pgh.pa.us
обсуждение исходный текст
Ответ на consequent PQsendQueryPrepared() failed: another command is already in progress  (Anton Maksimenkov <anton200@gmail.com>)
Ответы Re: consequent PQsendQueryPrepared() failed: another command is already in progress  (Anton Maksimenkov <anton200@gmail.com>)
Список pgsql-general
Anton Maksimenkov <anton200@gmail.com> writes:
> I'm using libpq C Library. I prepared some query and trying to call it
> many times.
> But it success only at first time, and then fail with error:
> ... "another command is already in progress"
> [ PQsendQuery followed by just one PQgetResult ]

IIRC, you need to keep calling PQgetResult until it returns NULL
before the connection is considered cleared and ready for another query.
In this example you should get a NULL on the very next call, but
you didn't make that call.

            regards, tom lane

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

Предыдущее
От: Stephen Frost
Дата:
Сообщение: Re: GSS Authentication
Следующее
От: sunpeng
Дата:
Сообщение: hi,i write a function in postgresql source code, how to register this function?