varchar sort ordering ignore blanks - SOLVED! - Mailing list pgsql-general

From Luca Arzeni
Subject varchar sort ordering ignore blanks - SOLVED!
Date
Msg-id trinity-b1456065-4ad9-4cfc-9313-e3915b3c4dc6-1435442725977@3capp-mailcom-lxa05
Whole thread Raw
List pgsql-general
To make a long story short, few years ago I was complaining that the sort order of varchar, in UTF-8, was ignoring
blanks,that is that the sort order was: 

XXXXa
XXXX a
XXXXA
XXXX A
XXXXà
XXXXb
XXXXB

But, i was in need of a sort order that would place blanks BEFORE the other char, that is I would like to have the
followingsort order: 

XXXX a
XXXX A
XXXXa
XXXXA
XXXXà
XXXXb
XXXXB

Now, using Debian Jessie, I found the solution to this issue. I needed to change the file

/usr/share/i18n/locales/iso14651_t1_common

placing in the proper position the sort order.

This is the output of the diff between the file before and after the modification:

diff iso14651_t1_common.orig  iso14651_t1_common

4837d4836
< <U0020> IGNORE;IGNORE;IGNORE;<U0020> # 32 <SP>
5080a5080
> <U0020> <BAS>;<MIN>;IGNORE # 32<SP>

Beware: the change is sistem wide, and regards all character sets and locales...



pgsql-general by date:

Previous
From: Francisco Olarte
Date:
Subject: Re: Inserting from multiple processes?
Next
From: Larry Meadors
Date:
Subject: Weird insert issue