HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlMinor

Invoke --data-checksums using pg_createcluster on Ubuntu 14.04

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
pg_createclusterubuntuchecksumsusinginvokedata

Problem

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

Solution

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)

Code Snippets

initdb_options = '--data-checksums'
data_checksums 
----------------
on
(1 row)

Context

StackExchange Database Administrators Q#139166, answer score: 4

Revisions (0)

No revisions yet.