Opened 13 years ago

Closed 12 years ago

#17207 closed Bug (fixed)

create_template_postgis-debian.sh cant use UTF8 on PostgreSQL 8.4

Reported by: artur@… Owned by: nobody
Component: GIS Version: dev
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

Description

Script create_template_postgis-debian.sh 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)

create_template_postgis-debian.sh.patch (125 bytes ) - added by artur@… 13 years ago.
Patch for create_template_postgis-debian.sh
17207-docs.patch (1.1 KB ) - added by John Paulett 13 years ago.
Documentation patch to note issue & workaround

Download all attachments as: .zip

Change History (5)

by artur@…, 13 years ago

Patch for create_template_postgis-debian.sh

comment:1 by Aymeric Augustin, 13 years ago

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 http://jacobian.org/writing/pg-encoding-ubuntu/.

by John Paulett, 13 years ago

Attachment: 17207-docs.patch added

Documentation patch to note issue & workaround

comment:2 by John Paulett, 13 years ago

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 by Claude Paroz <claude@…>, 12 years ago

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