How to find out if data checksum is enabled in Postgres

Postgres 9.3 introduces a data checksum function that can detect corruption on pages. Is there a way to query the database to determine if it is included?

Being hosted on a PaaS system, I do not have access to the actual server to check any configuration settings there. I also have access to our database, not the postgres database. Is there a way to determine if this is enabled only from the psql console?

+9
postgresql
source share
3 answers
show data_checksums; data_checksums ---------------- off 

http://www.postgresql.org/docs/current/static/runtime-config-preset.html

+14
source share

You can use pg_controldata if your postgresql cluster includes data_checksum. if version = 0, then your cluster will disable the function. And the data_checksums parameter adds PostgreSQL 9.3.4, if your version of postgresql is smaller than this, you cannot select this guc parameter. You must check it with a control file.

 pg93@db-172-16-3-150- > pg_controldata |grep checksum Data page checksum version: 0 
+1
source share

Starting from 9.4, you can try the following query:

select * from pg_settings where name ~ 'checksum';

https://paquier.xyz/postgresql-2/postgres-9-4-feature-highlight-data-checksum-switch-as-a-guc-parameter/

0
source share

All Articles