Re: LISTEN considered dangerous

From: Flemming Frandsen <ff(at)partyticket(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: LISTEN considered dangerous
Date: 2006-08-02 22:43:47
Message-ID: Pine.LNX.4.44.0608030040030.22172-100000@partyticket.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, 2 Aug 2006, Tom Lane wrote:

> Flemming Frandsen <ff(at)partyticket(dot)net> writes:
> > The listen should simply listen for events issued at the start of the
> > transaction it's executed in.
>
> BEGIN;
> SELECT sleep(1000000000);
> LISTEN foo;
>
> No, I don't think so.

And why would that be a problem?

There is no reason to assume that there would be any overhead in storing a
list of outstanding events for your connection compared to today.

What would happen in your example is that all the other connections leave
this slow transaction behind, but in stead of storing all the events for
all the transactions you can simply merge them all into one lump of events
that are waiting to be delivered to that slow client.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Flemming Frandsen 2006-08-02 22:53:28 Re: LISTEN considered dangerous
Previous Message Flemming Frandsen 2006-08-02 22:39:52 Re: LISTEN considered dangerous