Search code examples
postgresqllocalepostgisgeodjango

Change LC_CTYPE for PostgreSQL and PostGIS use


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.


Solution

  • 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