Re: Postgresql MVCC, Read Committed Isolation Level and taking "snapshot" - Mailing list pgsql-general

From Andrew Sullivan
Subject Re: Postgresql MVCC, Read Committed Isolation Level and taking "snapshot"
Date
Msg-id 20080520210425.GB84396@commandprompt.com
Whole thread Raw
In response to Re: Postgresql MVCC, Read Committed Isolation Level and taking "snapshot"  (Ivan Sergio Borgonovo <mail@webthatworks.it>)
Responses Re: Postgresql MVCC, Read Committed Isolation Level and taking "snapshot"  (Simon Riggs <simon@2ndquadrant.com>)
Re: Postgresql MVCC, Read Committed Isolation Level and taking "snapshot"  (Ivan Sergio Borgonovo <mail@webthatworks.it>)
List 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@commandprompt.com
+1 503 667 4564 x104
http://www.commandprompt.com/

pgsql-general by date:

Previous
From: "Scott Marlowe"
Date:
Subject: Re: best er modeling tool for postgreSQL
Next
From: johnduffy@f2s.com
Date:
Subject: Re: pgxs question - linking c-functions to external libraries