Re: How to create database with default system locale is set to et_EE.UTF-8

From: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Cc: "Andrus" <kobruleht2(at)hot(dot)ee>
Subject: Re: How to create database with default system locale is set to et_EE.UTF-8
Date: 2011-12-21 19:46:55
Message-ID: 201112211146.55547.adrian.klaver@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wednesday, December 21, 2011 10:28:24 am Andrus wrote:
> In fresh Debian installation default system locale is set to et_EE.UTF-8
> using
>
> dpkg-reconfigure locales
>
> Postgres is installed using
>
> apt-get update
> apt-get -t squeeze-backports install postgresql-9.1 postgresql-common
> postgresql-contrib
>
> Trying to create database with et_EE.UTF-8 collation and character type
> returns error
>
> ---------------------------
> pgAdmin III
> ---------------------------
> An error has occurred:
>
> ERROR: new collation (et_EE.UTF-8) is incompatible with the collation of
> the template database (en_US.UTF-8) HINT: Use the same collation as in
> the template database, or use template0 as template.
^^^^^^^^^^^^^^^^^^
See below for more info.

>
> How to create new database with et_EE.UTF-8 collation and character type ?

http://www.postgresql.org/docs/9.1/interactive/multibyte.html
22.3.2. Setting the Character Set

Notice that the above commands specify copying the template0 database. When
copying any other database, the encoding and locale settings cannot be changed
from those of the source database, because that might result in corrupt data.
For more information see Section 21.3."

From Section 21.3:
"To create a database by copying template0, use:

CREATE DATABASE dbname TEMPLATE template0;
"

> How to force Postgres installation to create template1 with et_EE.UTF-8
> collation and character type ?
>
> Andrus.

--
Adrian Klaver
adrian(dot)klaver(at)gmail(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Andre Lopes 2011-12-21 20:57:17 How to escape to quotes on Insert into?
Previous Message akp geek 2011-12-21 18:57:52 Re: Postgres Logs question