Re: sorting order

From: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>
To: Bertil(dot)Wergelius(at)telia(dot)com
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: sorting order
Date: 2002-03-01 10:50:35
Message-ID: 1014979836.5760.849.camel@linda
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Fri, 2002-03-01 at 10:10, Bertil Wergelius wrote:
> I have worked with a lot of different DBMSs. Ranging from MSSQL over Sybase
> SQL-anywhere to Interbase and most recently MySQL. With only the last mentioned
> has there been no problem that my language is Swedish and that I therefore want
> to use our own language's characters in correct sort order. MySQL gives a very
> pleasant experience when it comes to character sets, collation orders and all
> the rest; you don't have to care about it at all. That is perhaps because it is
> a swedish product (of Sweden and Finland).
> When I now start trying postgresql all the troubles with character sets come
> back. I've changed LANG to sv_SE and LC_COLLATE too, (in sysconfig/i18n and
> restarted) created the database with encoding LATIN1, but nothing helps.
> I can sort an ordinary textfile with cat textfile | sort. That sorts correctly
> so the collation must be correct, then why can't postgresql sort it correctly?

The locale must be set at the time you do initdb. This is because
indexes will be corrupted if the locale changes after they have had
items added.

In contrib, there is a utility pg_controldata which will show you what
locale the database is using. If it the wrong one, you must dump your
database, destroy it and do initdb again under the correct locale.

--
Oliver Elphick Oliver(dot)Elphick(at)lfix(dot)co(dot)uk
Isle of Wight http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C

"The LORD is my shepherd; I shall not want. He maketh
me to lie down in green pastures: he leadeth me beside
the still waters, he restoreth my soul...Surely
goodness and mercy shall follow me all the days of my
life; and I will dwell in the house of the LORD for
ever." Psalms 23:1,2,6

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Ivan Horvath 2002-03-01 11:15:03 timestamp value
Previous Message Bertil Wergelius 2002-03-01 10:10:10 sorting order