Skip site navigation (1) Skip section navigation (2)

Re: How to use PQconsumeInput and PQisBusy correctly ?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Rodrigo Moreno" <rodrigo(dot)miguel(at)terra(dot)com(dot)br>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: How to use PQconsumeInput and PQisBusy correctly ?
Date: 2005-03-13 18:54:14
Message-ID: 18233.1110740054@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-interfaces
"Rodrigo Moreno" <rodrigo(dot)miguel(at)terra(dot)com(dot)br> writes:
> What's the right way to use pqconsumeinput and pqisbusy ?
> The below code could be used to do that ? 

It would work but it seems rather pointless; the only reason you would
use those functions is if you have something else useful to do while
waiting for the query result ... and this program structure isn't
very conducive to doing other stuff while waiting.  Usually you'd want
to have a main loop that can dispatch handling of various events, one
of them being checking for an available query result.

The whole thing is a bit of a stone-age technique anyway; if you were
thinking of starting a new program today you'd probably use threads in
preference to an event loop.

			regards, tom lane

In response to

Responses

pgsql-interfaces by date

Next:From: Rodrigo MorenoDate: 2005-03-13 19:10:02
Subject: RES: How to use PQconsumeInput and PQisBusy correctly ?
Previous:From: Rodrigo MorenoDate: 2005-03-13 15:56:32
Subject: How to use PQconsumeInput and PQisBusy correctly ?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group