pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Rodrigo Moreno <rodrigo.miguel@terra.com.br>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: How to use PQconsumeInput and PQisBusy correctly ?
Date: Sun, 13 Mar 2005 13:54:14 -0500
Message-ID: <18233.1110740054@sss.pgh.pa.us> (raw)
In-Reply-To: <20050313155643.687B23C00B@talara.terra.com.br>
References: <20050313155643.687B23C00B@talara.terra.com.br>

"Rodrigo Moreno" <rodrigo.miguel@terra.com.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



view thread (2+ messages)

Message-ID: <18233.1110740054@sss.pgh.pa.us>
Permalink:  ../18233.1110740054@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/18233.1110740054@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: tgl@sss.pgh.pa.us, rodrigo.miguel@terra.com.br
  Subject: Re: How to use PQconsumeInput and PQisBusy correctly ?
  In-Reply-To: <18233.1110740054@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox