pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
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 12:06:36 -0500
Message-ID: <24912.1260464796@sss.pgh.pa.us> (raw)
In-Reply-To: <4B211D5E.2070107@postnewspapers.com.au>
References: <4B20F639.4070706@postnewspapers.com.au>
	<25363.1260457864@sss.pgh.pa.us>
	<4B211D5E.2070107@postnewspapers.com.au>

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



view thread (9+ messages)  latest in thread

Message-ID: <24912.1260464796@sss.pgh.pa.us>
Permalink:  ../24912.1260464796@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/24912.1260464796@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, craig@postnewspapers.com.au, pgsql-general@postgresql.org
  Subject: Re: Cheapest way to poll for notifications?
  In-Reply-To: <24912.1260464796@sss.pgh.pa.us>
  References: <4B20F639.4070706@postnewspapers.com.au> <25363.1260457864@sss.pgh.pa.us> <4B211D5E.2070107@postnewspapers.com.au> <24912.1260464796@sss.pgh.pa.us>

* 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