Skip to content

Commit

Permalink
Check block size from PGDATA against compiled in BLCKSZ and abort on …
Browse files Browse the repository at this point in the history
…mismatch.
  • Loading branch information
mbanck-ntap authored and mbanck committed Aug 28, 2018
1 parent a6ce285 commit 7618f25
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pg_checksums.c
Original file line number Diff line number Diff line change
Expand Up @@ -797,6 +797,17 @@ main(int argc, char *argv[])
exit(1);
}

/*
* Check that the PGDATA blocksize is the same as the one pg_checksums
* was compiled against (BLCKSZ).
*/
if (ControlFile->blcksz != BLCKSZ)
{
fprintf(stderr, _("%s: data directory block size %d is different to compiled-in block size %d.\n"),
progname, ControlFile->blcksz, BLCKSZ);
exit(1);
}

if (activate || verify)
{
#if PG_VERSION_NUM < 100000
Expand Down

0 comments on commit 7618f25

Please sign in to comment.