Re: Postgresql MVCC, Read Committed Isolation Level and taking "snapshot"

From: Andrew Sullivan <ajs(at)commandprompt(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Postgresql MVCC, Read Committed Isolation Level and taking "snapshot"
Date: 2008-05-20 21:04:25
Message-ID: 20080520210425.GB84396@commandprompt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, May 20, 2008 at 08:56:41PM +0200, Ivan Sergio Borgonovo wrote:

> I just would like to have a coherent snapshot of some tables.

If you have a multi-statement transaction, then if you are in READ
COMMITTED you can see changes, and if you are in SERIALIZABLE you
can't. You can't of course see changes "in the same statement" as it
were -- that's not meaningful (because either they committed before
you saw the row or after).

So,

> 1) check is some conditions are met with a bunch of selects and
> computation on returned rows
> 2) if everything is OK copy a "slice" of the snapshot in *other*
> tables.

This is more than one statement. So you will be able to see changes
in between those statements. If you don't care about that, then your
approach will work.

A

--
Andrew Sullivan
ajs(at)commandprompt(dot)com
+1 503 667 4564 x104
http://www.commandprompt.com/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message johnduffy 2008-05-20 21:58:00 Re: pgxs question - linking c-functions to external libraries
Previous Message Scott Marlowe 2008-05-20 20:16:54 Re: best er modeling tool for postgreSQL