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

2010-06-16 Thread Tom Lane
Anton Maksimenkov anton...@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

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

2010-06-16 Thread Yeb Havinga
Anton Maksimenkov wrote: 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 You are using the asynchronous queries while the testbed example program does

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

2010-06-16 Thread Jeff Davis
On Wed, 2010-06-16 at 10:26 +0600, Anton Maksimenkov wrote: if ((res = PQgetResult(conn)) == NULL) { fprintf(stderr, PQgetResult() res == NULL); PQfinish(conn); return -1; } if (PQresultStatus(res) != PGRES_TUPLES_OK) {

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

2010-06-16 Thread Anton Maksimenkov
2010/6/16 Tom Lane t...@sss.pgh.pa.us: 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

[GENERAL] consequent PQsendQueryPrepared() failed: another command is already in progress

2010-06-15 Thread Anton Maksimenkov
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 Here is my testbed: int main (register int const argc, register char *const argv[]) { PGconn