Re: LISTEN considered dangerous - Mailing list pgsql-general

From Flemming Frandsen
Subject Re: LISTEN considered dangerous
Date
Msg-id Pine.LNX.4.44.0608030033390.22172-100000@partyticket.net
Whole thread Raw
In response to Re: LISTEN considered dangerous  (Harald Fuchs <hf0731x@protecting.net>)
List pgsql-general
On 2 Aug 2006, Harald Fuchs wrote:

> > all events that have happened after the snapshot that the transaction
> > represents (the start of the transaction).
>
> Here you're contradicting yourself.  In your second paragraph you
> state that LISTEN should get events unless later cancelled by a
> ROLLBACK.  How should LISTEN know if its transaction will commit or
> abort?

No, I'm not contradicting myself.

What I'm saying is that if you listen for an event then that event should
be delivered in the next transaction, if it happens after the start of the
transaction that you listen in.


The reason for this is that while you are in a transaction you see the
world as it existed at the time the transaction was started.

So if you decide that you want to be told about something then that wish
has to be in effect from the time of the start of the transaction, because
otherwise the state of the delivered events is not consistent with the
state of the rest of the data.



pgsql-general by date:

Previous
From: MargaretGillon@chromalloy.com
Date:
Subject: Re: Tape backup, 2 versions, same database name, which is pg_dump
Next
From: Flemming Frandsen
Date:
Subject: Re: LISTEN considered dangerous