Re: How to add new Collation language

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Rob Northcott <Rob(dot)Northcott(at)compilator(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to add new Collation language
Date: 2017-09-14 13:52:55
Message-ID: 2555.1505397175@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Rob Northcott <Rob(dot)Northcott(at)compilator(dot)com> writes:
> From: rob stone [mailto:floriparob(at)gmail(dot)com]
>> On Thu, 2017-09-14 at 11:30 +0000, Rob Northcott wrote:
>>> How can I add a collation language to a Postgres server?
>>> Specifically, I want to create a new database with collation of
>>> English_United Kingdom.1252 but the only options are C, Posix and
>>> United States.
>>> This is Postgres 9.6 on Windows server 2012. The server is Swedish,
>>> and my user login is set to UK.

>> initdb --locale=en_GB.UTF-8 . . . plus other init options as required.

> Thanks for the reply. When I try that I get the message "invalid locale name"

en_GB.UTF-8 is a Unix-style locale name, it won't help you on Windows.
You need something like "English_United Kingdom.1252" on Windows.

I'm not sure what you mean by "the only options are" ... are you using
some GUI that only offers those options? If so, this is a shortcoming
in that GUI. Postgres itself should take whatever ctype/collation
settings the underlying system accepts. You could try manually invoking
initdb as above, but with a Windows-style locale name. Or if you want
to make a new database within an existing installation, use CREATE
DATABASE directly, setting the LC_COLLATE and LC_CTYPE options
(and selecting a matching ENCODING).

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Merlin Moncure 2017-09-14 13:54:21 Re: looking for a globally unique row ID
Previous Message Rob Northcott 2017-09-14 13:32:34 Re: How to add new Collation language