Re: LISTEN considered dangerous

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Oisin Glynn <me(at)oisinglynn(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Flemming Frandsen <ff(at)partyticket(dot)net>, pgsql-general(at)postgresql(dot)org
Subject: Re: LISTEN considered dangerous
Date: 2006-08-02 14:29:35
Message-ID: 20060802142935.GI29699@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Aug 02, 2006 at 09:15:46AM -0400, Oisin Glynn wrote:
> I was just about to say that if someone was to do the following they
> would get the previously commited state of foo after the sleep not how
> foo looked before the sleep otherwise every begin would need an entire
> DB snapshot to be taken? Seems like it should be no different. I have
> been following this thread as I use LISTEN but not in as intensive way
> as the op and for me its working fine...
>
> BEGIN
> select sleep(100000);
> select * from foo;

Well, it depends on the transaction mode, read-committed and
serialisable behave differently here. In the case of serializable, you
will get what was before the sleep(), that's kind of the point.

The whole point of MVCC is that taking a snapshot doesn't actually cost
anything.

Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Michael Meskes 2006-08-02 14:31:20 Re: ECPG and COPY
Previous Message Greg Stark 2006-08-02 14:28:18 Re: LISTEN considered dangerous