Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id E56471337B82 for ; Sat, 7 May 2011 10:34:14 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 38299-02 for ; Sat, 7 May 2011 13:34:08 +0000 (UTC) Received: from mx1.hub.org (mx1.hub.org [200.46.208.106]) by mail.postgresql.org (Postfix) with ESMTP id 0F3A21337B67 for ; Sat, 7 May 2011 10:34:08 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mx1.hub.org (Postfix) with ESMTP id 75EC93261BEE for ; Sat, 7 May 2011 13:34:07 +0000 (UTC) Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QIgR8-0003Mw-SR for pgsql-sql@postgresql.org; Sat, 07 May 2011 14:16:42 +0200 Received: from host-188-174-130-173.customer.m-online.net ([188.174.130.173]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 07 May 2011 14:16:42 +0200 Received: from spam_eater by host-188-174-130-173.customer.m-online.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 07 May 2011 14:16:42 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-sql@postgresql.org From: Thomas Kellerer Subject: Re: Specifying column level collations Date: Sat, 07 May 2011 14:16:35 +0200 Lines: 39 Message-ID: References: <4DC534E1.40801@lelarge.info> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: host-188-174-130-173.customer.m-online.net User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.21) Gecko/20090302 Thunderbird/2.0.0.21 Mnenhy/0.7.5.666 In-Reply-To: <4DC534E1.40801@lelarge.info> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.889 tagged_above=-5 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, T_TO_NO_BRKTS_FREEMAIL=0.01 X-Spam-Level: X-Archive-Number: 201105/42 X-Sequence-Number: 35326 Guillaume Lelarge wrote on 07.05.2011 14:02: >> create table foo (bar text collate "fr_FR") --> collation "fr_FR" for >> encoding "UTF8" does not exist >> create table foo (bar text collate "fr_FR.1252") --> collation "fr_FR" >> for encoding "UTF8" does not exist >> create table foo (bar text collate "fr_FR.UTF8") --> collation "fr_FR" >> for encoding "UTF8" does not exist >> create table foo (bar text collate "French_France.1252") --> collation >> "French_France.1252" for encoding "UTF8" does not exist >> >> So, how do I specify the collation there? >> > > You first need to use "CREATE COLLATION", such as: > > b1=# CREATE COLLATION fr (locale='fr_FR'); > CREATE COLLATION > Thanks for the quick answer. It seems there is something missing with my installation: postgres=# CREATE COLLATION fr (locale='fr_FR'); ERROR: could not create locale "fr_FR": No such file or directory I used the ZIP distribution from EnterpriseDB (not the installer) so maybe the support for collations is simply not included with the "plain" binaries. postgres=# select * from pg_collation; collname | collnamespace | collowner | collencoding | collcollate | collctype ----------+---------------+-----------+--------------+-------------+----------- default | 11 | 10 | -1 | | C | 11 | 10 | -1 | C | C POSIX | 11 | 10 | -1 | POSIX | POSIX (3 rows) Regards Thomas