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:39:52
Message-ID: Pine.LNX.4.44.0608030033390.22172-100000@partyticket.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Flemming Frandsen 2006-08-02 22:43:47 Re: LISTEN considered dangerous
Previous Message MargaretGillon 2006-08-02 21:55:10 Re: Tape backup, 2 versions, same database name, which is pg_dump