Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UTF8 is assumed as default #3

Closed
silverfisk opened this issue Jan 12, 2014 · 3 comments
Closed

UTF8 is assumed as default #3

silverfisk opened this issue Jan 12, 2014 · 3 comments

Comments

@silverfisk
Copy link

Not a big problem, but I noted that UTF8 is assumed as default in templates when creating Postgres database. If template0 is used during creation I think it will work better.

database.rb should probably look something like this:
postgresql_database settings['database']['name'] do
connection database_connection
connection_limit '-1'
encoding 'utf8'
template 'template0'
action :create
end

From http://www.postgresql.org/docs/9.0/static/manage-ag-templatedbs.html
"Another common reason for copying template0 instead of template1 is that new encoding and locale settings can be specified when copying template0, whereas a copy of template1 must use the same settings it does. This is because template1 might contain encoding-specific or locale-specific data, while template0 is known not to."

@bflad
Copy link
Contributor

bflad commented Jan 15, 2014

Interesting -- I wasn't aware of that option in postgres. I think it makes sense to switch it to template0.

@silverfisk
Copy link
Author

Yeah, I did not know about it eighter since I almost always use UTF8 anyway. But I realized I had to set LANG=C.UTF-8 when I created this Docker image

Unfortunately I didn't learn how to make all the tests this cookbook require or I could probably have committed something on this

@lock
Copy link

lock bot commented May 10, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators May 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants