Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 6198F632EB4 for ; Thu, 10 Dec 2009 13:06:44 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 98097-10 for ; Thu, 10 Dec 2009 17:06:37 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 03A07632A28 for ; Thu, 10 Dec 2009 13:06:36 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id nBAH6ap0024913; Thu, 10 Dec 2009 12:06:36 -0500 (EST) To: Craig Ringer cc: PG-General Mailing List Subject: Re: Cheapest way to poll for notifications? 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> Comments: In-reply-to Craig Ringer message dated "Fri, 11 Dec 2009 00:10:06 +0800" Date: Thu, 10 Dec 2009 12:06:36 -0500 Message-ID: <24912.1260464796@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200912/445 X-Sequence-Number: 156665 Craig Ringer 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