On 2018-08-30 10:39:26 -0400, Tom Lane wrote:
> char buf[BLCKSZ];
> PageHeader header = (PageHeader) buf;
> (The right fix, of course, is to malloc the work buffer rather than
> put it on the stack.)
Or alternatively, for places where such allocations could be a problem
for performance, using a union can be used to force the required
alignment. I'm fairly certain that just allocating is more than OK
here, to be clear.
Greetings,
Andres Freund