Last active
January 3, 2019 22:09
-
-
Save hSATAC/51a13739c2fc678ed3f4 to your computer and use it in GitHub Desktop.
Set postgresql template1 encoding to UTF8 in Puppet.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exec { "postgresql-template1-utf8": | |
command => "psql -c \"update pg_database set datistemplate=false where datname='template1';\" && | |
psql -c 'drop database Template1;' && | |
psql -c \"create database template1 with owner=postgres encoding='UTF-8' lc_collate='en_US.utf8' lc_ctype='en_US.utf8' template template0;\" | |
", | |
user => "postgres", | |
path => "/usr/bin", | |
unless => "/usr/bin/psql -Atc \"select pg_encoding_to_char(encoding) from pg_database where datname='template1'\" | /bin/grep -c UTF8" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment