Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id F34AF632416 for ; Mon, 1 Mar 2010 09:49:34 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 34027-03 for ; Mon, 1 Mar 2010 13:49:24 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by mail.postgresql.org (Postfix) with SMTP id 2BF79632202 for ; Mon, 1 Mar 2010 09:49:23 -0400 (AST) Received: (qmail 31675 invoked by uid 0); 1 Mar 2010 13:49:22 -0000 Received: from 192.124.237.7 by www033.gmx.net with HTTP; Mon, 01 Mar 2010 14:49:21 +0100 (CET) Content-Type: text/plain; charset="us-ascii" Date: Mon, 01 Mar 2010 14:49:21 +0100 From: "Jan-Peter Seifert" In-Reply-To: Message-ID: <20100301134921.175810@gmx.net> MIME-Version: 1.0 References: Subject: Re: LATIN2 encoding and Polish_Poland locale To: Andrzej Angowski , pgsql-admin@postgresql.org X-Authenticated: #955937 X-Flags: 0001 X-Mailer: WWW-Mail 6100 (Global Message Exchange) X-Priority: 3 X-Provags-ID: V01U2FsdGVkX18FbT5d9EsF1Rby12oHSYTVlXCe/pgfFip0M4QiAx mHoIXd3okPYOhkesjIlBW9wNWLRtJRxi/tvg== Content-Transfer-Encoding: 7bit X-GMX-UID: 2feyfpYJeWUoS0n3fXVzgbwxU3U4Nw8J X-FuHaFi: 0.48999999999999999 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 201003/2 X-Sequence-Number: 33801 Hello Andrzej, try this: Identify the code page Windows is using for LATIN2 with the PostgreSQL tool pg_controldata (8.2 server's version). Look for the number following the dot in LC_COLLATE / LC_TYPE. For LATIN1 it's 28591. Try creating the database for 8.4 with the PostgreSQL tool createdb (v8.4.x) (example for LATIN1 and German locale, locale = LC_COLLATE / LC_TYPE in 8.2): createdb -U postgres -h -p --owner=name_of_owner --locale=German_Germany.28591 --encoding=LATIN1 --template=template0 database_name Good luck, Peter -------- Original-Nachricht -------- > Datum: Sun, 28 Feb 2010 22:44:49 +0100 > Von: Andrzej Angowski > An: pgsql-admin@postgresql.org > Betreff: [ADMIN] LATIN2 encoding and Polish_Poland locale > All, > > I am running PostgreSQL database on Windows XP with SP3 machine. > Recently I have tried to upgrade from 8.2.15 to 8.4.2 but I encounter > the following issue: one of my databases is LATIN2 encoded > (ISO-8859-2). It works fine on 8.2.15 (LATIN2 encoding and > Polish_Poland locale - I have Polish characters and sorting works > fine), but on 8.4.2 default encoding for Polish_Poland is UTF-8. When > I try to set up LATIN2 encoding with Polish_Poland locale I get the > following error: > > >createdb -E LATIN2 -l Polish_Poland test > createdb: database creation failed: ERROR: encoding LATIN2 does not > match locale Polish_Poland > DETAIL: The chosen LC_CTYPE setting requires encoding WIN1250. > > In 8.4 manual -> Section 22.2 Character Set Support one can read: > An important restriction, however, is that each database's character > set must be compatible with the database's LC_CTYPE and LC_COLLATE > locale settings. For C or POSIX locale, any character set is allowed, > but for other locales there is only one character set that will work > correctly. (On Windows, however, UTF-8 encoding can be used with any > locale.) > > So I manage to establish a DB with LATIN2 encoding with C locale: > >createdb -E LATIN2 -l C -T template0 test > > I have Polish characters but sorting is not correct. > > How can I set up Polish_Poland locale with LATIN2 encoding in PostgreSQL > 8.4.2? > > > Thanks, > -- > Andrzej Angowski > > -- > Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-admin -- Sicherer, schneller und einfacher. Die aktuellen Internet-Browser - jetzt kostenlos herunterladen! http://portal.gmx.net/de/go/chbrowser