Postgres 9.3 introduces a data checksum feature which can detect corruption in pages. Is there a way to query the database to determine if this is on?
Being hosted on a PaaS system, I don't have access to the actual server to check any configurations settings there. I also only have access to our database and not the main postgres database either. Is there a way to determine if this is on from a psql console only?
Data checksums are enabled or disabled at the full cluster level, and cannot be specified individually for databases or tables. The current state of checksums in the cluster can be verified by viewing the value of the read-only configuration variable data_checksums by issuing the command SHOW data_checksums .
pg_checksums checks, enables or disables data checksums in a PostgreSQL cluster. The server must be shut down cleanly before running pg_checksums. When verifying checksums, the exit status is zero if there are no checksum errors, and nonzero if at least one checksum failure is detected.
Use \l or \l+ in psql to show all databases in the current PostgreSQL server. Use the SELECT statement to query data from the pg_database to get all databases.
initdb initializes the database cluster's default locale and character set encoding. The character set encoding, collation order ( LC_COLLATE ) and character set classes ( LC_CTYPE , e.g., upper, lower, digit) can be set separately for a database when it is created.
From 9.4 on, 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/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With