]> granicus.if.org Git - postgresql/commit
Fix possible page corruption by ALTER TABLE .. SET TABLESPACE.
authorRobert Haas <rhaas@postgresql.org>
Thu, 29 Jul 2010 16:14:45 +0000 (16:14 +0000)
committerRobert Haas <rhaas@postgresql.org>
Thu, 29 Jul 2010 16:14:45 +0000 (16:14 +0000)
commit7958520d2c54abd5efbcf5f664193cb5a6a99fd7
tree45254f564df1d4d7d149cf711953f04347e10380
parent40cacbb376a7a5ec3f4de54d8bb510527dd2b246
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