Re: LISTEN considered dangerous - Mailing list pgsql-general

From Flemming Frandsen
Subject Re: LISTEN considered dangerous
Date
Msg-id Pine.LNX.4.44.0608030040030.22172-100000@partyticket.net
Whole thread Raw
In response to Re: LISTEN considered dangerous  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: LISTEN considered dangerous
List pgsql-general
On Wed, 2 Aug 2006, Tom Lane wrote:

> Flemming Frandsen <ff@partyticket.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.




pgsql-general by date:

Previous
From: Flemming Frandsen
Date:
Subject: Re: LISTEN considered dangerous
Next
From: Flemming Frandsen
Date:
Subject: Re: LISTEN considered dangerous