[OSM-dev] postgresql issue

Jon Burgess jburgess777 at googlemail.com
Sat Mar 7 09:55:10 GMT 2009


On Sat, 2009-03-07 at 13:02 +0530, Arindam Ghosh wrote:
> Hi all
> 
> I updated to postgresql-8.3-postgis in the freemap.in which was
> required for new mapnik
> [http://trac.mapnik.org/wiki/DebianInstallation]
> 
> The mapnik from the svn was in turn required for latest mod_tile.
> 
> But now as i create a new db say 'gis' ex:
> $ createdb -E UTF8 -0 username gis
> 
> I get following error related to encoding actually:
> 
> ----------------------
> createdb: database creation failed: ERROR:  encoding UTF8 does not
> match server's locale en_US
> DETAIL:  The server's LC_CTYPE setting requires encoding LATIN1.
> ----------------------
> 
> On googling, i found some similar recent threads like [1] & [2]
> The threads semms to suggest for fixing LC_ALL variable and then
> re-initdb. But that may require db backup and restore.
> 
> Is there any simpler way to get around this thing?? Please help me on this  :)

I believe this is the only solution. It it explained at (1) and in the
initdb manual page

 initdb  initializes  the  database  cluster’s  default  locale and character set encoding. The collation order (LC_COLLATE) and character set
 classes (LC_CTYPE, e.g. upper, lower, digit) are fixed for all databases and cannot be changed. Collation orders other than C or  POSIX  also
 have  a  performance  penalty.   For these reasons it is important to choose the right locale when running initdb. The remaining locale cate-
 gories can be changed later when the server is started. All server locale values (lc_*) can be displayed via SHOW ALL.  More details  can  be
 found in in the documentation.

On debian derived systems, the initdb command is wrapped by the
pg_createcluster script.

	Jon


[1] http://www.postgresql.org/docs/8.3/static/multibyte.html






More information about the dev mailing list