> > 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.
pgsql-hackers by date
|Next:||From: Mikheev, Vadim||Date: 2001-03-28 18:10:02|
|Subject: RE: Re: [SQL] possible row locking bug in 7.0.3 & 7.1 |
|Previous:||From: Thomas Swan||Date: 2001-03-28 16:55:35|
|Subject: Re: Feature Request: ALTER FUNCTION (or something like that)|
pgsql-sql by date
|Next:||From: Douglas Brunton||Date: 2001-03-28 18:24:11|
|Subject: Oracle -> Postgresql migration|
|Previous:||From: Tom Lane||Date: 2001-03-28 16:17:55|
|Subject: Re: DELETE FROM fails with error |