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

2 Answers 2


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:

(1 row)

According the pg_createcluster usage message, initdb arguments have to go after a double dash.

pg_createcluster --datadir=foo/cluster_name 9.3 cluster_name -- --data-checksums
  • Using this syntax gives: "Warning: cluster names containing dashes (-) will cause problems when running from systemd. Continuing anyway", creating the cluster, without the data-checksums parameter set Commented May 21, 2016 at 23:36
  • 1
    JFI @user2277435: "pg_createcluster 10 my_cluster -- --data-checksums" works as expected
    – alfonx
    Commented Oct 1, 2018 at 21:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.