pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Merlin Moncure <mmoncure@gmail.com>
To: Craig Ringer <craig@postnewspapers.com.au>
Cc: PG-General Mailing List <pgsql-general@postgresql.org>
Subject: Re: Cheapest way to poll for notifications?
Date: Thu, 10 Dec 2009 10:48:24 -0500
Message-ID: <b42b73150912100748r2f3a3fcelb4ea9e43f9e0f0b7@mail.gmail.com> (raw)
In-Reply-To: <4B20F639.4070706@postnewspapers.com.au>
References: <4B20F639.4070706@postnewspapers.com.au>

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



view thread (9+ messages)  latest in thread

Message-ID: <b42b73150912100748r2f3a3fcelb4ea9e43f9e0f0b7@mail.gmail.com>
Permalink:  ../b42b73150912100748r2f3a3fcelb4ea9e43f9e0f0b7@mail.gmail.com/
Also on:    postgresql.org/message-id/b42b73150912100748r2f3a3fcelb4ea9e43f9e0f0b7@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: mmoncure@gmail.com, craig@postnewspapers.com.au, pgsql-general@postgresql.org
  Subject: Re: Cheapest way to poll for notifications?
  In-Reply-To: <b42b73150912100748r2f3a3fcelb4ea9e43f9e0f0b7@mail.gmail.com>
  References: <4B20F639.4070706@postnewspapers.com.au> <b42b73150912100748r2f3a3fcelb4ea9e43f9e0f0b7@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox