We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0daf411 commit e1034d9Copy full SHA for e1034d9
manifests/server/initdb.pp
@@ -80,5 +80,21 @@
80
}
81
82
83
+ } elsif $encoding != undef {
84
+ # [workaround]
85
+ # by default pg_createcluster encoding derived from locale
86
+ # but it do does not work by installing postgresql via puppet because puppet
87
+ # always override LANG to 'C'
88
+ postgresql_psql { "Set template1 encoding to ${encoding}":
89
+ command => "UPDATE pg_database
90
+ SET datistemplate = FALSE
91
+ WHERE datname = 'template1'
92
+ ;
93
+ UPDATE pg_database
94
+ SET encoding = pg_char_to_encoding('${encoding}'), datistemplate = TRUE
95
+ WHERE datname = 'template1'",
96
+ unless => "SELECT datname FROM pg_database WHERE
97
+ datname = 'template1' AND pg_encoding_to_char(encoding) = '${encoding}'",
98
+ }
99
100
0 commit comments