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

From Merlin Moncure
Subject Re: Cheapest way to poll for notifications?
Date
Msg-id b42b73150912100748r2f3a3fcelb4ea9e43f9e0f0b7@mail.gmail.com
Whole thread Raw
In response to Cheapest way to poll for notifications?  (Craig Ringer <craig@postnewspapers.com.au>)
Responses Re: Cheapest way to poll for notifications?  (Craig Ringer <craig@postnewspapers.com.au>)
List pgsql-general
On Thu, Dec 10, 2009 at 8:23 AM, Craig Ringer
<craig@postnewspapers.com.au> wrote:
> Hi
>
> As Pg doesn't presently support client push for notifications arising from
> LISTEN/NOTIFY, I'm wondering if anybody here has done any research into the
> cheapest statement to issue to check for such notifications.

notifications are sent to the client as soon as they are generated and
the socket is not otherwise being used.  psql just prints the
notifcation message following a query because that happens to be a
convenient place to do it.  The only polling that has to be done (if
any) is 100% client side.  There is an excellent example (in C) in the
documentation showing a method of waiting on the connection socket for
notification events when the connection is not in use by the client.

merlin

pgsql-general by date:

Previous
From: Vick Khera
Date:
Subject: Re: Defining permissions for tables, schema etc..
Next
From: Craig Ringer
Date:
Subject: Re: Cheapest way to poll for notifications?