May 2019
Intermediate to advanced
600 pages
20h 46m
English
In our example, we have showed a case where the checksum fails. The checksum mismatch will also be detected when a query causes PostgreSQL to attempt reading that block into the shared buffers.
In that case, the query will fail with an error, which is good because it protects the user from inadvertently using corrupt data:
postgres=# SELECT * FROM t;WARNING: page verification failed, calculated checksum 42501 but expected 37058ERROR: invalid page in block 0 of relation base/16385/16388
If we want to intentionally load corrupt data, for example, to attempt some repair activities, we can temporarily disable the checksum, as in the following example:
postgres=# SET ignore_checksum_failure = on;postgres=# SELECT * FROM t;WARNING: ...
Read now
Unlock full access