Thread: [libpq] Async Queries and the Order of Execution
Hi everyone!
I have some very simple, single-threaded, client-side C code:
...
// Here I PQgetResult and PQclear it when done. Not shown to keep brevity.
}
Now I'm curious whether the queries [1] are executed in the same order as they are being sent..?
I have some very simple, single-threaded, client-side C code:
...
PQsendPrepare(...);
PQsetnonblocking(...);
while(1) {
PQsendQueryPrepared(...); // [1]while(1) {
// Here I PQgetResult and PQclear it when done. Not shown to keep brevity.
}
Now I'm curious whether the queries [1] are executed in the same order as they are being sent..?
My experiments indicate that this is the case, but is it guaranteed?
Best Regards,
HD
Helmut Dittenwald wrote: > I have some very simple, single-threaded, client-side C code: > > ... > PQsendPrepare(...); > PQsetnonblocking(...); > while(1) { > PQsendQueryPrepared(...); // [1] > // Here I PQgetResult and PQclear it when done. Not shown to keep brevity. > } > > Now I'm curious whether the queries [1] are executed in the same order as they are being sent..? > My experiments indicate that this is the case, but is it guaranteed? Yes, they will be sent in the order you indicate, and they will be executed in the order in which they were sent. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com