Re: Is vacuum full lock like old's vacuum's lock? - Mailing list pgsql-general

From Tom Lane
Subject Re: Is vacuum full lock like old's vacuum's lock?
Date
Msg-id 26850.1015633485@sss.pgh.pa.us
Whole thread Raw
In response to Re: Is vacuum full lock like old's vacuum's lock?  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-general
Martijn van Oosterhout <kleptog@svana.org> writes:
> Actually, it seems to me you could get this to play with MVCC by treating
> the move as a UPDATE that does nothing. Copy the tuple from the end to the
> beginning, mark the end one as deleted and the beginning one as new. Voila,
> tuple moved and everything will eventually use the new one and ignore the
> old one.

... except for scans in progress ...

VACUUM FULL is indeed like an UPDATE as far as crash recovery goes:
either the original tuple or the moved one is good, never both.  The
problem is to ensure that concurrent scans will see the tuple correctly.

            regards, tom lane

pgsql-general by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: How to check for successfull inserts
Next
From: Thomas Lockhart
Date:
Subject: Re: decimal(5) vs int8. Which more efficient.