PQsendQuery - Mailing list pgsql-general

From Michael Simms
Subject PQsendQuery
Date
Msg-id 199908050302.EAA18663@argh.demon.co.uk
Whole thread Raw
In response to ElephantWear Now Available...  (The Hermit Hacker <scrappy@hub.org>)
List pgsql-general
Hi

I have a query regarding PQsendQuery that doesnt seem to be well explained
in the docs. My basic situation is that I want to run a series of queries
quickly, and I dont care what the result of them is (it is an insert).

1 ) When I run PQsendQuery(), can I then immediately run PQexec() or do I
have to wait till the PQsendQuery has returned.

2 ) If I use PQconsumeInput(), does this tell the backend to not send the
results of any queries pending? Or do I still get new ones coming back at me?

3 ) Finally, what happens if I close the database connection when I still have
a queue of queries sitting in the PQsendQuery queue?

From what I have observed, I would guess:

1 ) PQexec is safe and jumps to the front of the queue
2 ) All future queries are still piped through
3 ) The unhandled queries are trashed.

Thanks
                    M Simms

pgsql-general by date:

Previous
From: Héctor Morales
Date:
Subject: Problem with pgaccess
Next
From: "sam smith"
Date:
Subject: "group, by", problem, when, combined, with, "insert, into"