Re: [HACKERS] Re: Non-blocking queries in postgresql - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] Re: Non-blocking queries in postgresql
Date
Msg-id 14183.917453145@sss.pgh.pa.us
Whole thread Raw
In response to Re: Non-blocking queries in postgresql  (Bruce Momjian <maillist@candle.pha.pa.us>)
List pgsql-hackers
>>>>>> But I have a llitle problem. I`m afraid that the lipq++ interface
>>>>>> doesn't have this funcion call. Is it true?
>>>>>> Have you got any examples of the using of PQsendQuery and Non Blocking
>>>>>> queries using this interface lipq or libpq++? I will be very usefull for
>>>>>> me. Just simply attach it on the response.
>>>> 
>>>> Maybe it hasn't been added to libpq++ yet.

Indeed it has not been added to libpq++.  (libpq++ desperately needs to
be adopted by some caring soul.  None of the current contributors to
Postgres seem to use it, so it's not getting maintained.  As long as it
keeps compiling we just ignore it...)


>> BUT I`AM VERY INTERESTED ON FINDING EXAMPLES OF USING
>> NON-BLOCKING QUERIES with libpq.

The trouble is that applications that need to do this are usually
non-trivial; I doubt you'll find any simple readily-available examples.

The only such application I've built myself is a C++/Tcl/Tk app
in which the Tcl user interface remains "live" during SQL query execution,
rather than freezing up during each query as it does with libpgtcl's
pg_exec.  The idea is to enter a nested Tcl event loop after firing off
a query with PQsendQuery.  Checking for the response is done by a Tcl
file handler that creates a special event type when the query is
complete, and execution of that event type sets a flag to get out of the
nested event loop.  Meanwhile, regular Tcl events such as keypresses
and mouse actions are responded to by the nested event loop.

It'd be difficult to explain it more fully than that without showing you
large chunks of the application code, which I can't really do because
it's proprietary software :-(.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] Problem with multiple SUMs
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] Problem with multiple SUMs