Executing multiple statements in a single query?
Executing multiple statements in a single query?
От:
HK <harikrishnan@midascomm.com>
Дата:
hi all, I am using postgresql from a c application with asyncronous Query processing. Since only 1 query can be executed at a time, i am using a buffering mechanism to store the other queries generated at that time. Is there any way i can execute all the statements in the buffer with a single query. Thanx in advance. -- regards, hari
Re: Executing multiple statements in a single query?
От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
HK writes: > I am using postgresql from a c application with asyncronous Query > processing. Since only 1 query can be executed at a time, i am using a > buffering mechanism to store the other queries generated at that time. Is > there any way i can execute all the statements in the buffer with a single > query. You can ship 'em all in a single PQsendQuery string, and wait for the successive results to come back. Not sure if that's what you had in mind... regards, tom lane
Where does pgsql store the tables ??
От:
HK <harikrishnan@midascomm.com>
Дата:
hi tom,
Thanx for the reply. Thats wat i am doing. The problem was i didnt
wait for all the replies.
I have two doubts.
1) When a table is created in the database, in
wat file does pg store the data. Also where are the index files
stored.
2) In asynchronous queries, can i dispense with pqflush(). If i can, what
are all the cases where i can do so. On average my queries will be 8k
in size.
thanx in advance.
--
regards
hari
On Wed, 25 Sep 2002, Tom Lane wrote:
> HK writes:
> > I am using postgresql from a c application with asyncronous Query
> > processing. Since only 1 query can be executed at a time, i am using a
> > buffering mechanism to store the other queries generated at that time. Is
> > there any way i can execute all the statements in the buffer with a single
> > query.
>
> You can ship 'em all in a single PQsendQuery string, and wait for the
> successive results to come back. Not sure if that's what you had in
> mind...
>
> regards, tom lane
>
Re: Where does pgsql store the tables ??
От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
HK writes: > 2) In asynchronous queries, can i dispense with pqflush(). You don't need PQflush() unless you are using the nonblocking mode (which I don't really recommend, as it has too many restrictions and bugs^H^H^H^Hweird behaviors). regards, tom lane
When to send the next asyncronous query
От:
HK <harikrishnan@midascomm.com>
Дата:
hi tom, In asyncronous queries, after i send the first query, when should i send the next query. Will adding the fd of postgrey to writefd in select of c help. Or how long do i need to wait before sending the next query. Thanx in advance. On Mon, 30 Sep 2002, Tom Lane wrote: > HK writes: > > 2) In asynchronous queries, can i dispense with pqflush(). > > You don't need PQflush() unless you are using the nonblocking mode > (which I don't really recommend, as it has too many restrictions and > bugs^H^H^H^Hweird behaviors). > > regards, tom lane > -- regards, hari
Re: When to send the next asyncronous query
От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
HK writes: > In asyncronous queries, after i send the first query, when should > i send the next query. After PQgetResult() returns NULL. contrib/pgbench is an example of how to use this stuff. I'm afraid there are no other examples in the standard PG distribution :-( regards, tom lane