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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Anton Maksimenkov <anton200(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: consequent PQsendQueryPrepared() failed: another command is already in progress
Date: 2010-06-16 14:39:20
Message-ID: 6768.1276699160@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Anton Maksimenkov <anton200(at)gmail(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message greigwise 2010-06-16 14:48:55 Re: GSS Authentication
Previous Message greigwise 2010-06-16 14:17:10 Re: GSS Authentication