Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to tell if data checksum feature is on in Postgres

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?

like image 658
D-Rock Avatar asked Apr 11 '14 11:04

D-Rock


People also ask

How do I enable a data page checksum?

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 .

What is Pg_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.

How do I show DBS in PostgreSQL?

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.

What is Initdb in PostgreSQL?

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.


1 Answers

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/

like image 84
maletin Avatar answered Oct 04 '22 00:10

maletin