PostgreSQL – Invoke –data-checksums Using pg_createcluster on Ubuntu 14.04

postgresqlUbuntu

How do you pass the initdb argument for data checksums to pg_createcluster when creating the initial cluster?

Passing the argument as per initdb fails for me:

pg_createcluster --data-checksums --datadir=foo/cluster_name 9.5 cluster_name

Best Answer

After further investigation, to specify the default initdb arguments used in pg_createcluster, the below was added in /etc/postgresql-common/createcluster.conf:

initdb_options = '--data-checksums'

Then pg_createcluster was run as normal and show data_checksums displays:

data_checksums 
----------------
on
(1 row)