>> I read the manual again and now I understand that it's the libpq client
>> library which requires polling a function to retrieve the notifications
>> received from the server. Is there no way to tell the library "please
>> call me when a notification arrives"?
> No, because it's only a library, it doesn't have its own thread of
Just to learn something new:
Is this because the library implementor has chosen to do it this way or
because there is no way to spawn a thread from this library?
I'm just a poor Python scripting dilettant for whom threads and such things
are deep black voodoo, so please excuse me if this question is utterly
The reason why I am asking for notification without polling is that I would
like to use a shared PostgreSQL database for data exchange with other
applications, and the data exchange is likely to happen very intermittently,
i.e. the data from other applications it will typically arrive in large
batches, with long pauses (sometimes hours) in between. But I still want to
get the data as soon as it is available, to not let the end-users wait for
> If you are so inclined you can set up your application's main loop to
> watch for input on the database connection's socket (along with whatever
> other event sources it watches) and then call the library to see what it
Thanks, that's exactly what the example for Psycopg2 does apparently.
My email-address is correct.
Do NOT remove ".nospam" to reply.
In response to
pgsql-novice by date
|Next:||From: Wolfgang Keller||Date: 2006-09-21 15:10:59|
|Subject: Re: Server->Client notification (without polling)?|
|Previous:||From: Tony Davis||Date: 2006-09-21 12:41:59|
|Subject: Instal 8.1.4 on XP Home|