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

Re: libpq, blocking/nonblocking mechanism

From: Terry Lee Tucker <terry(at)esc1(dot)com>
To: PostgreSQL Interfaces <pgsql-interfaces(at)postgresql(dot)org>
Subject: Re: libpq, blocking/nonblocking mechanism
Date: 2005-06-01 19:10:10
Message-ID: 200506011510.10371.terry@esc1.com (view raw or flat)
Thread:
Lists: pgsql-interfaces
On Wednesday 01 June 2005 02:18 pm, Volkan YAZICI saith:
> Hi,
>
> On 5/31/05, Terry Lee Tucker <terry(at)esc1(dot)com> wrote:
> [snipped]
>
> > I'm looking at the documentation in:
> > file:/usr/share/doc/postgresql-7.4.6/html/libpq-async.html
> > on my machine.
>
> Thanks so much, but I'm able to read manuals too.

From your original message:
"P.S. Documentation pointers will be accepted with pleasure too."

> I'm trying to don't
> carry my questions here until I finish a satisfying
> postgresql.org/docs plus google.com search. Namely, I read that lines
> nearly I hundred times.
>
> I advice you to looking at my question twice.
PQsetnonblocking () causes PQsendQuery to send an sql string to the backend 
and it returns immediately if you have set nonblocking to true. If you have 
not set nonblocking to true, then PQsendQuery behaves just like PQexec; it 
blocks, i.e., it waits for the query, update, delete, or whatever to complete 
before it returns program control back to your program. We set nonblocking to 
True in our application and when the user queries a large table that could 
return thousands of records, we use PQsendQuery instead of PQexec; however, 
if you do that, then you have to use PQconsumeInput and PQisBusy in 
conjunction with a select statement to monitor the backend connection socket 
so you can process the results when the query finishes. Another reason for 
using asynchronous queries is that you can provide a mechanism for the user 
to cancel the operation.  Our application is X-Windows based written in C. 
All my examples are C. If you want to see any of it, you can let me know.

>
> Regards.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: the planner will ignore your desire to choose an index scan if your
>       joining column's datatypes do not match

In response to

Responses

pgsql-interfaces by date

Next:From: setyawankimDate: 2005-06-03 03:10:44
Subject: unsubscribe
Previous:From: Volkan YAZICIDate: 2005-06-01 18:18:18
Subject: Re: libpq, blocking/nonblocking mechanism

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