From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | pgsql(at)frenzy(dot)org |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: "another command is already in progress" error (fwd) |
Date: | 2003-09-11 20:55:16 |
Message-ID: | 1314.1063313716@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
pgsql(at)frenzy(dot)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
From | Date | Subject | |
---|---|---|---|
Next Message | Sean Chittenden | 2003-09-11 21:24:25 | Re: State of Beta 2 |
Previous Message | Tom Lane | 2003-09-11 20:47:07 | Re: Picture with Postgres and Delphi |