Opened 8 years ago

Closed 7 years ago

#17207 closed Bug (fixed) cant use UTF8 on PostgreSQL 8.4

Reported by: artur@… Owned by: nobody
Component: GIS Version: master
Severity: Normal Keywords: postgis
Cc: john@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Script tested on Debian Squeeze:

createdb: database creation failed: ERROR:  new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII)

To fix this script specify non default template to use by createdb:

createdb -E UTF8 --template=template0 template_postgis && \

Attachments (2) (125 bytes) - added by artur@… 8 years ago.
Patch for
17207-docs.patch (1.1 KB) - added by John Paulett 7 years ago.
Documentation patch to note issue & workaround

Download all attachments as: .zip

Change History (5)

Changed 8 years ago by artur@…

Patch for

comment:1 Changed 7 years ago by Aymeric Augustin

Patch needs improvement: set
Triage Stage: UnreviewedAccepted

I think this depends on how the template0 and template1 database were created, which in turn depends on your locale.

I use GeoDjango on stock Debian Squeeze, and I never encountered that problem, probably because my locale is en_US.UTF-8.

Rather than editing the script, I think we should document the issue and provide resolution steps. See

Changed 7 years ago by John Paulett

Attachment: 17207-docs.patch added

Documentation patch to note issue & workaround

comment:2 Changed 7 years ago by John Paulett

Cc: john@… added
Patch needs improvement: unset

I agree with aaugustin. I have occasionally encountered this bug if the OS's locale is not en-us.UTF8 (or similar). Vagrant seems to only use "en-us" in their lucid base boxes.

Attached is a patch with adds a troubleshooting note to the documentation and links to Jacob's workaround.

comment:3 Changed 7 years ago by Claude Paroz <claude@…>

Resolution: fixed
Status: newclosed

In 725128289398ba4bce60a4093d9d69bbcea01d92:

Fixed #17207 -- Added a troubleshooting note about failing createdb

Note: See TracTickets for help on using tickets.
Back to Top