Question about MVCC-unsafe commands - Mailing list pgsql-hackers

From Antonin Houska
Subject Question about MVCC-unsafe commands
Date
Msg-id 18172.1471961425@localhost
Whole thread Raw
Responses Re: Question about MVCC-unsafe commands
List pgsql-hackers
I'm failing to understand why [1] mentions "table-rewriting forms of ALTER
TABLE" besides TRUNCATE command.

For TRUNCATE it seems clear: if transaction A takes the snapshot before it
accesses the table first time (typically because isolation level is at least
REPEATABLE READ) and transaction B manages to commit TRUNCATE soon enough,
then A sees pg_class entry of the table already affected by B, which has the
new (empty) relfilenode. (The original pg_class entry is no longer visible by
catalog snapshot, nor does it contain valid OID of the original relfilenode.)

But IMO heap rewriting changes neither table contents, nor visibility. Can
anyone explain what I miss?

[1] https://www.postgresql.org/docs/9.6/static/mvcc-caveats.html
--
Antonin Houska
Cybertec Schönig & Schönig GmbH
Gröhrmühlgasse 26
A-2700 Wiener Neustadt
Web: http://www.postgresql-support.de, http://www.cybertec.at



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: "Some tests to cover hash_index"
Next
From: Robert Haas
Date:
Subject: Re: [PATCH] Transaction traceability - txid_status(bigint)