(MODULES-1834) Be less strict when changing template1 encoding

We currently use: UTF8 != UTF-8
We should instead use: pg_char_to_encoding(UTF8) == pg_char_to_encoding(UTF-8)
This commit is contained in:
Mathieu Parent 2015-03-10 09:58:33 +01:00
parent 317c146629
commit f3a0db44ef

View file

@ -94,7 +94,7 @@ class postgresql::server::initdb {
SET encoding = pg_char_to_encoding('${encoding}'), datistemplate = TRUE
WHERE datname = 'template1'",
unless => "SELECT datname FROM pg_database WHERE
datname = 'template1' AND pg_encoding_to_char(encoding) = '${encoding}'",
datname = 'template1' AND encoding = pg_char_to_encoding('${encoding}')",
}
}
}