Listen/Notify in 9.0

Lists: pgsql-hackers
From: Kaare Rasmussen <kaare(at)jasonic(dot)dk>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Listen/Notify in 9.0
Date: 2010-07-09 14:07:06
Message-ID: 201007091607.06904.kaare@jasonic.dk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi

As I understand the changes to the notification system in 9.0, apart from
being able to carry a payload, it will guarantee the order of delivery, and
also it will keep the notification and notify any listener, even if the
listener didn't register at the time of notification. Is this correct?

What happens if the listener process dies, for how long time will it take up
ressources?
What happens if the listener process never picks up the notification, same
question?
What happens if the same process makes the same LISTEN request again. Will it
take up more ressources?

--

Med venlig hilsen
Kaare Rasmussen, Jasonic

Jasonic Telefon: +45 3816 2582
Nordre Fasanvej 12
2000 Frederiksberg Email: kaare(at)jasonic(dot)dk


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Kaare Rasmussen <kaare(at)jasonic(dot)dk>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Listen/Notify in 9.0
Date: 2010-07-15 19:47:20
Message-ID: 10611.1279223240@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Kaare Rasmussen <kaare(at)jasonic(dot)dk> writes:
> As I understand the changes to the notification system in 9.0, apart from
> being able to carry a payload, it will guarantee the order of delivery, and
> also it will keep the notification and notify any listener, even if the
> listener didn't register at the time of notification. Is this correct?

Well, order of delivery depends on commit order, so there's only a
pretty weak guarantee there, although I guess it is stronger than
before. As for the other thing, listeners are *not* guaranteed to
get any notices that were committed before they commit their LISTEN.
They are guaranteed to get ones that were committed afterwards, but
that's the same as before.

regards, tom lane