Opened 4 years ago

Closed 3 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: 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

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@… 4 years ago.
Patch for create_template_postgis-debian.sh
17207-docs.patch (1.1 KB) - added by jpaulett 3 years ago.
Documentation patch to note issue & workaround

Download all attachments as: .zip

Change History (5)

Changed 4 years ago by artur@…

Patch for create_template_postgis-debian.sh

comment:1 Changed 3 years ago by aaugustin

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement set
  • Triage Stage changed from Unreviewed to Accepted

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/.

Changed 3 years ago by jpaulett

Documentation patch to note issue & workaround

comment:2 Changed 3 years ago by jpaulett

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

  • Resolution set to fixed
  • Status changed from new to closed

In 725128289398ba4bce60a4093d9d69bbcea01d92:

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

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