Alex Rivera | Logout

Change LC_CTYPE for PostgreSQL and PostGIS use

Asked 2011-12-02T03:25:18.893
19

So I'm walking through the GeoDjango tutorial and I'm stuck on this error message:

postgres@lucid32:~$ createdb -E UTF8 template_postgis
createdb: database creation failed: ERROR:  encoding UTF8 does not match locale en_US
DETAIL:  The chosen LC_CTYPE setting requires encoding LATIN1.

I've googled and read some Ubuntu docs but to no avail. Any insight would be greatly appreciated!

I'm using the default Vagrant Box lucid 32, for testing out my setup.

Edit
Report

2 Answers

13

It is better to just specify the locale for the database and have the encoding be figured out from that. So use something like

createdb --locale=en_US.utf8 template_postgis
answered 2011-12-02T13:55:57.163
2

You need to set your operating system's locale to any utf8 compatible locale. Run locale -a to get a list of locales you can use, and then do something like update-locale LANG=en_US.utf8, replacing en_US.utf8 with whatever locale you want.

answered 2011-12-02T04:00:13.167

Your Answer