Fix another longstanding problem in copy_relation_data: it was blithely

Tom Lane <tgl@sss.pgh.pa.us>

Commit: 8e21bf52504616024618f3386dc68e8936405dc2
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2010-07-29T19:24:05Z
Releases: 8.0.26
Fix another longstanding problem in copy_relation_data: it was blithely
assuming that a local char[] array would be aligned on at least a word
boundary.  There are architectures on which that is pretty much guaranteed to
NOT be the case ... and those arches also don't like non-aligned memory
accesses, meaning that log_newpage() would crash if it ever got invoked.
Even on Intel-ish machines there's a potential for a large performance penalty
from doing I/O to an inadequately aligned buffer.  So palloc it instead.

Backpatch to 8.0 --- 7.4 doesn't have this code.

Files

PathChange+/−
src/backend/commands/tablecmds.c modified +14 −3