Skip site navigation (1) Skip section navigation (2)

Re: Listen / Notify questions

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Joost Kraaijeveld <J(dot)Kraaijeveld(at)Askesis(dot)nl>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: Listen / Notify questions
Date: 2006-07-09 16:51:03
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-interfaces
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;

> 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.

Michael Fuhr

In response to

pgsql-interfaces by date

Next:From: wolfgang.weningDate: 2006-07-11 15:57:24
Subject: No library found for -lpq
Previous:From: Joost KraaijeveldDate: 2006-07-09 09:43:15
Subject: Listen / Notify questions

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group