> >> This is OK for table files, unless someone's broken the
> >> code that will auto-initialize a zero page when it comes across one.
>
> > Hmmm, I don't see anything like auto-initialization in code -:(
> > Where did you put these changes?
>
> I didn't put 'em in, it looked like your work to me: see vacuum.c,
> lines 618-622 in current sources.
Oh, this code was there from 6.0 days.
> Awhile back I did fix PageGetFreeSpace and some related macros to
> deliver sane results when looking at an all-zero page header, so that
> scans and inserts would ignore the page until vacuum fixes it.
I see now - PageGetMaxOffsetNumber... Ok.
> Perhaps WAL redo needs to be prepared to do PageInit as well?
It calls PageIsNew and uses flag in record to know when a page could
be uninitialized.
> Actually, I'd expect the CRC check to catch an all-zeroes page (if
> it fails to complain, then you misimplemented the CRC), so that would
> be the place to deal with it now.
I've used standard CRC32 implementation you pointed me to -:)
But CRC is used in WAL records only.
Vadim