Monday, November 23, 2009

Get Married Half Moon Cay

Keypad innopérant or blocked Linux Ubuntu (with Gnome)

On a recent distribution with the database Postgresql
I could not create a new comic with a latin1 encoding.
After some research the problem is installing the package has the cluster is created with UTF8 encoding, watch to check the value of: / usr/lib/postgresql/8.3/bin/pg_controldata / var / lib/postgresql/8.3/main /
In my case I had: LC_COLLATE: fr_CH.UTF -8 LC_CTYPE: fr_CH.UTF-8
But the problem with this config is that the coup when we want to create a new database with a different encoding nothing goes.
su postgres-c 'createdb-E-O LATIN1 cgdb goeland'
See you receive a strong message unsympathetic shaped end of inadmissibility:
createdb: database creation failed: ERROR: encoding LATIN1 does not match the local server fr_CH.UTF-8
DETAIL: The server's LC_CTYPE setting requires encoding UTF8.

The explanation lies in the postgresql documentation If we are to lor the creation of database use any encoding should be used for initdb "C" or "POSIX" for the default locale So the solution is to break the default cluster (remember to backup before) Hum Again WARNING do not run on a server pg_dropcluster prod with data as it is clear that destroyed irreparably your Data
localedef 8.3-f ISO-8859-1-i fr_CH fr_CH.ISO
-8859-1 export LANG = "fr_CH.iso88591"
pg_createcluster - Local fr_CH.iso88591 8.3
    hand
  1. Following is the fixed password with postgresql:
  2. su postgres psql template1

ALTER USER postgres WITH PASSWORD '123456 ';
And here now you can create a comic with LATIN1

su-c "createdb-E LATIN1 mabellebdenlatin1" postgres

0 comments:

Post a Comment