X-Original-To: pgsql-interfaces-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 58D019FB1CA for ; Sun, 9 Jul 2006 13:51:18 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 20794-09 for ; Sun, 9 Jul 2006 13:51:14 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by postgresql.org (Postfix) with ESMTP id F33069FB1BC for ; Sun, 9 Jul 2006 13:51:13 -0300 (ADT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.7/8.13.7) with ESMTP id k69Gp5cd094032 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 9 Jul 2006 10:51:07 -0600 (MDT) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.6/8.13.6) with ESMTP id k69Gp4R2063582; Sun, 9 Jul 2006 10:51:04 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.6/8.13.6/Submit) id k69Gp3PS063581; Sun, 9 Jul 2006 10:51:03 -0600 (MDT) (envelope-from mfuhr) Date: Sun, 9 Jul 2006 10:51:03 -0600 From: Michael Fuhr To: Joost Kraaijeveld Cc: pgsql-interfaces@postgresql.org Subject: Re: Listen / Notify questions Message-ID: <20060709165103.GB63466@winnie.fuhr.org> References: <1152438195.17031.5.camel@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1152438195.17031.5.camel@localhost> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200607/2 X-Sequence-Number: 6192 On Sun, Jul 09, 2006 at 11:43:15AM +0200, Joost Kraaijeveld wrote: > 1. Is there a way to determine which sessions are listening for a > certain notify message? SELECT * FROM pg_listener; http://www.postgresql.org/docs/8.1/interactive/catalog-pg-listener.html > 2. If a session ends without "unlisten" (e.g. my listening program > crashes), is that session automatically removed from the list of > sessions that should be notified? According to the LISTEN documentation, "A session's listen registrations are automatically cleared when the session ends." You can confirm this by querying pg_listener. http://www.postgresql.org/docs/8.1/interactive/sql-listen.html -- Michael Fuhr