]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix possible page corruption by ALTER TABLE .. SET TABLESPACE.
authorRobert Haas <rhaas@postgresql.org>
Thu, 29 Jul 2010 16:15:33 +0000 (16:15 +0000)
committerRobert Haas <rhaas@postgresql.org>
Thu, 29 Jul 2010 16:15:33 +0000 (16:15 +0000)
commit76a106f264b78b35b4f522e07cca84b90af83f50
treebf54b2a0395c864d35346264f8cb0f8db588d471
parent7c294bf761c3329e42d4ede04e976f7c0145f7e8
Fix possible page corruption by ALTER TABLE .. SET TABLESPACE.

If a zeroed page is present in the heap, ALTER TABLE .. SET TABLESPACE will
set the LSN and TLI while copying it, which is wrong, and heap_xlog_newpage()
will do the same thing during replay, so the corruption propagates to any
standby.  Note, however, that the bug can't be demonstrated unless archiving
is enabled, since in that case we skip WAL logging altogether, and the LSN/TLI
are not set.

Back-patch to 8.0; prior releases do not have tablespaces.

Analysis and patch by Jeff Davis.  Adjustments for back-branches and minor
wordsmithing by me.
src/backend/access/heap/heapam.c
src/backend/commands/tablecmds.c