Re: "another command is already in progress" error (fwd)
От | Tom Lane |
---|---|
Тема | Re: "another command is already in progress" error (fwd) |
Дата | |
Msg-id | 1314.1063313716@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | "another command is already in progress" error (fwd) (pgsql@frenzy.org) |
Список | pgsql-general |
pgsql@frenzy.org writes: > I am doing asynchronous sql calls using the postgres C library. > After doing two PQsendQuery() calls, I get the > "another command is already in progress" error. > The two calls I am doing are an update, and then an insert, in that order. > I am doing this for speed, since my program can't afford to wait for the > answer from the first to complete before making the request for the > second. > For some reason this method has started giving the error above, even > though it has been running on the same testing box for its entire > lifecycle and it wasn't before. I don't think I believe that; that has never been supported. If you have several commands you'd like to fire off as a batch, you can put them in a single PQsendQuery (with semicolons between of course). Then keep reading PGresults until you get a NULL. But you can't issue another PQsendQuery until you've gotten that NULL. At least, not on the same connection. I'm not sure opening multiple connections could be a win for you, but it might be something to think about. regards, tom lane
В списке pgsql-general по дате отправления: