some installations have data which is only rarerly read, and if they areso large that dumps are not routinely taken, data corruption would onlybe detected with some large delay even with checksums enabled.

The attached small patch verifies checksums (in case they are enabled)during a basebackup. The rationale is that we are reading every block inthis case anyway, so this is a good opportunity to check them as well.Other and complementary ways of checking the checksums are possible ofcourse, like the offline checking tool that Magnus just submitted.

It probably makes sense to use the same approach for determining thesegment numbers as Magnus did in his patch, or refactor that out in autility function, but I'm sick right now so wanted to submit this forv11 first.

I did some light benchmarking and it seems that the performancedegradation is minimal, but this could well be platform orarchitecture-dependent. Right now, the checksums are always checked butmaybe this could be made optional, probably by extending the replicationprotocol.