pgsql: Improve documentation about MVCC-unsafe utility commands.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Improve documentation about MVCC-unsafe utility commands.
Date: 2015-08-15 17:30:42
Message-ID: E1ZQfI2-0007aZ-VW@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Improve documentation about MVCC-unsafe utility commands.

The table-rewriting forms of ALTER TABLE are MVCC-unsafe, in much the same
way as TRUNCATE, because they replace all rows of the table with newly-made
rows with a new xmin. (Ideally, concurrent transactions with old snapshots
would continue to see the old table contents, but the data is not there
anymore --- and if it were there, it would be inconsistent with the table's
updated rowtype, so there would be serious implementation problems to fix.)
This was nowhere documented though, and the problem was only documented for
TRUNCATE in a note in the TRUNCATE reference page. Create a new "Caveats"
section in the MVCC chapter that can be home to this and other limitations
on serializable consistency.

In passing, fix a mistaken statement that VACUUM and CLUSTER would reclaim
space occupied by a dropped column. They don't reconstruct existing tuples
so they couldn't do that.

Back-patch to all supported branches.

Branch
------
REL9_2_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/ed51165907e5b413cf221bd82c7f4274bf6ab58f

Modified Files
--------------
doc/src/sgml/mvcc.sgml | 46 ++++++++++++++++++++++++++-----------
doc/src/sgml/ref/alter_table.sgml | 19 ++++++++++-----
doc/src/sgml/ref/truncate.sgml | 23 +++++--------------
3 files changed, 51 insertions(+), 37 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2015-08-15 18:32:45 pgsql: Add docs about postgres_fdw's setting of search_path and other G
Previous Message Tom Lane 2015-08-15 16:01:03 pgsql: Repair unsafe use of shared typecast-lookup table in plpgsql DO