Re: Cheapest way to poll for notifications? - Mailing list pgsql-general

From Tom Lane
Subject Re: Cheapest way to poll for notifications?
Date
Msg-id 24912.1260464796@sss.pgh.pa.us
Whole thread Raw
In response to Re: Cheapest way to poll for notifications?  (Craig Ringer <craig@postnewspapers.com.au>)
List pgsql-general
Craig Ringer <craig@postnewspapers.com.au> writes:
> Tom Lane wrote:
>> The backend certainly will push the notification.  Maybe you just have
>> a client-side-software issue?

> Testing with two plain old psql sessions to an 8.4.1 DB on linux (Ubuntu
> 9.10) here, I don't see the asynchronous notification until I send some
> other command to the database from the client. It's the same over a
> local UNIX socket or a loopback TCP/IP connection (with SSL).

psql is not too bright about that; when it's waiting for user input it
just waits.  But I don't think it matters because nobody is going to
write an application that depends on this in psql anyway.  If you are
writing something that uses libpq directly, it's certainly possible to
watch for incoming notifies along with whatever else your event loop is
watching for.  (I had an application that did so a dozen years ago...)

            regards, tom lane

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Fw: ERROR: could not open relation with OID 59132
Next
From: Postgre Novice
Date:
Subject: Re: Fw: ERROR: could not open relation with OID 59132