Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1agoxV-0005y3-BB for pgsql-admin@arkaria.postgresql.org; Fri, 18 Mar 2016 07:36:33 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1agoxU-0004Rv-2B for pgsql-admin@arkaria.postgresql.org; Fri, 18 Mar 2016 07:36:32 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1agoxT-0004Qk-E1 for pgsql-admin@postgresql.org; Fri, 18 Mar 2016 07:36:31 +0000 Received: from shopzeus.com ([87.229.70.149]) by magus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1agoxL-00061E-73 for pgsql-admin@postgresql.org; Fri, 18 Mar 2016 07:36:30 +0000 Received: from [127.127.127.127] (localhost [127.127.127.127]) (Authenticated sender: gandalf) by shopzeus.com (Postfix) with ESMTPSA id A8C0C889C4FC for ; Fri, 18 Mar 2016 03:36:20 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shopzeus.com; s=shopzeus_com; t=1458286580; bh=Bqrjztxqxdst/LHfCfbSXMEy0VpkA8dNk3K3BjnH/rg=; h=Subject:To:References:From:Date:In-Reply-To:From; b=YhyB0SGeqv0+Zh/SpohWg5dbHvnnOa4B4e6yTfdbuVjKZ5EgEnCALHIrXGOqsLXpn 5NmW5Idh+nwbERJyYCZjiGLM2k6/TZaJ1Dzg1ubnHdiRdEhbAreEdHGNsGrWI2QY+o VZCDlZdVhLpfGVXD81JDpboOqf2yXBjxtGJNDua6JE02I6FYwUc9uHB+TTtsAeCZC7 CieWrmsQ7iIDbUXterkjJiFFdKADt//ZjJ3/k0RPe8sP8HbmZgMlLiq/i1CRShPjir axx4s5Qbo3hpyNiFwW+9AhA+UvjCD6MfNe5PBC87mvTqLJUp5n23laHUBKx66+jiz8 j6gbduxLQzzhA== Subject: Re: How to setup a good collation? [SOLVED] To: pgsql-admin@postgresql.org References: <56DBF4B7.1050200@shopzeus.com> <56DBFB0F.4080705@shopzeus.com> <56DBFE00.40504@shopzeus.com> <56EA5DA7.4060505@shopzeus.com> From: =?UTF-8?Q?Nagy_L=c3=a1szl=c3=b3_Zsolt?= Message-ID: <56EBAFEE.6090701@shopzeus.com> Date: Fri, 18 Mar 2016 08:36:14 +0100 MIME-Version: 1.0 In-Reply-To: <56EA5DA7.4060505@shopzeus.com> Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: quoted-printable X-Pg-Spam-Score: -4.3 (----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org >>> All right, I have reinstalled postgresql server with "Use ICU for >>> unicode collation" but it did not help! >> Postgres 9.3 on FreeBSD 10.2 with kernel, userland and software from >> ports compiled with clang. Server compile flags include ICU in >> addition of the defaults and client flags using non-GPL libedit >> instead of readline. > Thank you for testing this! I have 9.4 but probably that doesn't matter. > I'm not sure what is causing the problem on my box. I'll be installing a > new virtual machine and try other variations/settings. Will be back > with the results soon. I have tried to do this the cleanest way possible, and not it is working. Thank you for your help! I'm going to provide detailed steps below to help others with similar problems. Steps taken: #1. Installed a new virtual machine with the latest 10.2 RELEASE amd64 #2. Installed all available system updates via freebsd-update #3. Downloaded the latest ports tree with "portsnap fetch; portsnap extract". #4. Configured PostgreSQL 9.4.6 server port with the following options: * ICU - Use ICU for unicode collation * INTDATE - builds with 64-bit date/time type * NLS - Use internationalized messages * SSL - build with openssl support * TZDATA * XML There are the defaults, except for ICU. I have used 9.4 instead of 9.5 because that is the default postgresql server in FreeBSD 10.2 #5. I have compiled and installed the server from the ports tree. This was a fresh BSD install, so all of the port dependencies were also installed from source. #6. Added this to /etc/login.conf: postgres:\ :lang=3Dhu_HU.UTF-8:\ :setenv=3DLC_COLLATE=3Dhu_HU.UTF-8:\ :tc=3Ddefault: and ran "cap_mkdb /etc/login.conf" #7 Database initialization this way: su -l pgsql initdb --encoding=3DUTF-8 --lc-collate=3Dhu_HU.UTF-8 --lc-ctype=3Dhu_HU.UTF-8 --locale=3Dhu_HU.UTF-8 -D /usr/local/pgsql/data (Note: list all available locales with "locale -a" command) #8. Created a new user and database: template1=3D# create user test with password 'test' createdb; CREATE ROLE template1=3D# create database test with owner=3Dtest template=3Dtemplate0 encoding=3D'UTF-8' lc_collate=3D'hu_HU.UTF-8' lc_ctype=3D'hu_HU.UTF-8'; CREATE DATABASE Finally, got it working: create table a (name text ); insert into a values ('a'); insert into a values ('=E1'); insert into a values ('=C1'); insert into a values ('b'); insert into a values ('e'); insert into a values ('=E9'); insert into a values ('=C9'); insert into a values ('o'); insert into a values ('=F3'); insert into a values ('=F6'); insert into a values ('U'); insert into a values ('=DC'); insert into a values ('Z'); select name from a order by upper(name) asc; "a" "=E1" "=C1" "b" "e" "=E9" "=C9" "o" "=F3" "=F6" "U" "=DC" "Z" I'm not sure what was the problem. There many places where I could have forgotten something. --=20 Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin