]> 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:18 +0000 (16:15 +0000)
committerRobert Haas <rhaas@postgresql.org>
Thu, 29 Jul 2010 16:15:18 +0000 (16:15 +0000)
commitfb28d2604a419c48b0f6f8df46198a90d8343209
tree47222d4ef1399e172de4889e550e82ce9b8720e6
parent44b16a2cf51a66c475a53435755724cd5cbbbd4e
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