Skip to content

Commit db9b347

Browse files
authored
Merge pull request puppetlabs#915 from mmoll/pr_855
enhance --data-checksums on initdb
2 parents f7bd101 + ae38fa6 commit db9b347

File tree

2 files changed

+24
-10
lines changed

2 files changed

+24
-10
lines changed

README.md

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,16 @@ Default value: OS dependent.
449449

450450
**Warning:** If datadir is changed from the default, Puppet does not manage purging of the original data directory, which causes it to fail if the data directory is changed back to the original.
451451

452+
##### `data_checksums`
453+
454+
Optional.
455+
456+
Data type: Boolean.
457+
458+
Use checksums on data pages to help detect corruption by the I/O system that would otherwise be silent. Valid values: 'true' or 'false'. Default: initdb's default ('false').
459+
460+
**Warning:** This option is used during initialization by initdb, and cannot be changed later. If set, checksums are calculated for all objects, in all databases.
461+
452462
##### `default_database`
453463

454464
Specifies the name of the default database to connect with.
@@ -499,16 +509,6 @@ Default value: `undef`, which is effectively 'C'.
499509

500510
**On Debian, you'll need to ensure that the 'locales-all' package is installed for full functionality of PostgreSQL.**
501511

502-
##### `data_checksums`
503-
504-
Optional.
505-
506-
Data type: Boolean.
507-
508-
Turns on data checksums during `initdb`.
509-
510-
Default value: `undef`, which is the same as `false`.
511-
512512
##### `timezone`
513513

514514
Sets the default timezone of the postgresql server. The postgresql built-in default is taking the systems timezone information.
@@ -751,6 +751,16 @@ The name of the PostgreSQL Python package.
751751

752752
Default value: '${bindir}/createdb'.
753753

754+
##### `data_checksums`
755+
756+
Optional.
757+
758+
Data type: Boolean.
759+
760+
Use checksums on data pages to help detect corruption by the I/O system that would otherwise be silent. Valid values: 'true' or 'false'. Default: initdb's default ('false').
761+
762+
**Warning:** This option is used during initialization by initdb, and cannot be changed later. If set, checksums are calculated for all objects, in all databases.
763+
754764
##### `default_database`
755765

756766
Specifies the name of the default database to connect with. On most systems this is 'postgres'.

manifests/params.pp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,10 @@
309309
}
310310
}
311311

312+
if($data_checksums and versioncmp($version, '9.3') < 0) {
313+
fail('data_checksums require version 9.3 or greater')
314+
}
315+
312316
$validcon_script_path = pick($validcon_script_path, '/usr/local/bin/validate_postgresql_connection.sh')
313317
$initdb_path = pick($initdb_path, "${bindir}/initdb")
314318
$pg_hba_conf_path = pick($pg_hba_conf_path, "${confdir}/pg_hba.conf")

0 commit comments

Comments
 (0)