Re: Prepared transactions vs novice DBAs, again

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, Jeff Davis <pgsql(at)j-davis(dot)com>, jd(at)commandprompt(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Prepared transactions vs novice DBAs, again
Date: 2009-04-23 03:04:41
Message-ID: 13294.1240455881@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> Maybe I'm just dumb, but I don't get it. If I start a transaction and
> do "SELECT * FROM foo" and then wait around for an hour or two while
> someone else makes changes to foo and then do "SELECT * FROM foo"
> again, I expect to see the same rows I saw the first time, which means
> they still need to be around.

That only happens in a serializable transaction, ie, one that took
*and kept* a snapshot at transaction start. In READ COMMITTED mode
we drop all snaps between statements, so there is nothing stopping
reclaiming of rows that were visible to prior statements.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2009-04-23 04:09:30 Re: The last WAL segment of the old timeline is not archived for a while after archive recovery
Previous Message Tom Lane 2009-04-23 02:47:54 Re: 8.4b1 regression?