Re: sorting and spaces in postgresql with en_US locale

From: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>
To: Chris Kratz <chris(dot)kratz(at)vistashare(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: sorting and spaces in postgresql with en_US locale
Date: 2004-07-21 21:26:10
Message-ID: 1090445169.25749.169.camel@linda
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, 2004-07-21 at 20:58, Chris Kratz wrote:
> We are having a weird problem that we ran into recently. If I use the
> following statements to create a test table and then run the select statement
> at the end, we get a very strange sort order. It appears that to do the
> sorting, all the spaces are removed from the strings. It would appear that in
> the example below 'ab e' should be before 'abd'.

> LC_COLLATE: en_US
> LC_CTYPE: en_US

That is how the en_US (and en_GB) locales are defined.

Their sorting is dictionary style: spaces and capitalisation are
ignored. This is a glibc issue, not a PostgreSQL issue.

--
Oliver Elphick olly(at)lfix(dot)co(dot)uk
Isle of Wight http://www.lfix.co.uk/oliver
GPG: 1024D/A54310EA 92C8 39E7 280E 3631 3F0E 1EC0 5664 7A2F A543 10EA
========================================
"Greater love hath no man than this, that a man lay
down his life for his friends." John 15:13

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Thomas F.O'Connell 2004-07-21 23:50:07 Re: Indexes and Tables: Growth and Treatment
Previous Message Lee Harr 2004-07-21 21:13:45 Re: get first / last date of given week