From: Mikheev, Vadim <vmikheev@SECTORBASE.COM>
To: 'Hiroshi Inoue' <Inoue@tpf.co.jp>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Philip Warner <pjw@rhyme.com.au>
Cc: pgsql-sql@postgresql.org
Cc: pgsql-hackers@postgresql.org
Subject: RE: [HACKERS] Re: possible row locking bug in 7.0.3 & 7.1
Date: Wed, 28 Mar 2001 09:58:43 -0800
Message-ID: <8F4C99C66D04D4118F580090272A7A234D3356@sectorbase1.sectorbase.com> (raw)
> > I don't think that we dare try to make any basic changes in
> > MVCC for 7.1 at this late hour, so Forest is going to have
> > to live with that answer for awhile. But I would like to see
> > a cleaner answer in future releases.
>
> Is it the MVCC's restriction that each query inside a function
> must use the same snapshot ?
No. MVCC restricts what is visible to query itself. Current
function' behaviour is like Oracle' one.
Strictly speaking queries inside function don't use the same
snapshot - they see changes made by other queries of this
function. Should we allow them see changes made by other
transactions? I'm not sure. Maybe by special means like
CREATE SNAPSHOT S;
SELECT FROM foo WITH SNAPSHOT S;
?
For this particular case - concurrent UPDATE then
UPDATE/DELETE + SELECT - there is simple solution: meeting
tuple updated by concurrent *committed* transaction
SELECT (in READ COMMITTED mode) should look in newer tuple
versions. If some of newer tuples is invalidated (updated/deleted)
by *this* transaction and this invalidation is *visible*
to SELECT (older CommandId) then old tuple version must not
be returned (newer tuple version will be returned of course).
Reported problem is caused by bug (only one tuple version must be
returned by SELECT) and this is way to fix it.
But note that for the case of concurrent DELETE then
INSERT + SELECT two tuples will be returned anyway and
I don't think that this is bug.
> > As I've opined before, the whole EvalPlanQual mechanism
> > strikes me as essentially bogus in any case...
>
> How would you change it ? UPDATE/SELECT FOR UPDATE have to
> SELECT/UPDATE the latest tuples. I don't think of any simple
> way for 'SELECT FOR UPDATE' to have the same visibility as
> simple SELECT.
Yes, I also don't understand what's wrong with EvalPlanQual.
Vadim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: vmikheev@SECTORBASE.COM, Inoue@tpf.co.jp, tgl@sss.pgh.pa.us, pjw@rhyme.com.au, pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] Re: possible row locking bug in 7.0.3 & 7.1
In-Reply-To: <8F4C99C66D04D4118F580090272A7A234D3356@sectorbase1.sectorbase.com>
References: <8F4C99C66D04D4118F580090272A7A234D3356@sectorbase1.sectorbase.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox