[SQL] a strange order by behavior

2011-06-22 Thread Eyal Wilde
the database collation is: en_US.UTF-8 drop table t1; create table t1 (recid int ,f1 varchar(20)); insert into t1 values (1,'a'); insert into t1 values (2,' '); insert into t1 values (3,'aa'); insert into t1 values (4,' a'); select * from t1 order by f1 result: recid f1 2 1 a

Re: [SQL] a strange order by behavior

2011-06-22 Thread Samuel Gendler
On Tue, Jun 21, 2011 at 3:37 AM, Eyal Wilde e...@impactsoft.co.il wrote: the database collation is: en_US.UTF-8 drop table t1; create table t1 (recid int ,f1 varchar(20)); insert into t1 values (1,'a'); insert into t1 values (2,' '); insert into t1 values (3,'aa'); insert into t1 values

Re: [SQL] a strange order by behavior

2011-06-22 Thread Pavel Stehule
Hello a equalent of C collate for UTF8 is ucs_basic Regards Pavel Stehule 2011/6/22 Samuel Gendler sgend...@ideasculptor.com: On Tue, Jun 21, 2011 at 3:37 AM, Eyal Wilde e...@impactsoft.co.il wrote: the database collation is: en_US.UTF-8 drop table t1; create table t1 (recid int ,f1

Re: [SQL] a strange order by behavior

2011-06-22 Thread Samuel Gendler
Interesting. The original thread to which I was referring has a subject of Sorting Issue and the original request showed a list of vehicle model names which were sorting as though there were no spaces. The user had collation set to en_US.UTF-8. However, my database (on OS X) sorts both his

Re: [SQL] a strange order by behavior

2011-06-22 Thread Pavel Stehule
Hello Peter Pavel suggested using a collation of ucs_basic, but I get an error when I try that on linux: $ createdb -U u1 --lc-collate=ucs_basic -E UTF-8 test createdb: database creation failed: ERROR:  invalid locale name ucs_basic isn't this a bug in collations? Regards Pavel I was

Re: [SQL] a strange order by behavior

2011-06-22 Thread Samuel Gendler
On Wed, Jun 22, 2011 at 2:39 AM, Samuel Gendler sgend...@ideasculptor.comwrote: I was able to create the db with --lc_collate=C and get case-sensitive sorting that treats spaces 'correctly,' but I have no idea how reliable that is with multibyte characters and it almost certainly doesn't

Re: [SQL] a strange order by behavior

2011-06-22 Thread Samuel Gendler
On Wed, Jun 22, 2011 at 3:01 AM, Pavel Stehule pavel.steh...@gmail.comwrote: Hello Peter Pavel suggested using a collation of ucs_basic, but I get an error when I try that on linux: $ createdb -U u1 --lc-collate=ucs_basic -E UTF-8 test createdb: database creation failed: ERROR:

Re: [SQL] a strange order by behavior

2011-06-22 Thread Samuel Gendler
On Wed, Jun 22, 2011 at 3:39 AM, Samuel Gendler sgend...@ideasculptor.comwrote: On Wed, Jun 22, 2011 at 3:01 AM, Pavel Stehule pavel.steh...@gmail.comwrote: Hello Peter Pavel suggested using a collation of ucs_basic, but I get an error when I try that on linux: $ createdb -U u1

Re: [SQL] a strange order by behavior

2011-06-22 Thread Pavel Stehule
I'm actually surprised that european users aren't complaining about this all the time, but maybe european users are used to seeing things ordered in a manner which doesn't honour the 'correct' ordering of accented characters.  Actually, I wonder if the probable explanation of the lack of

Re: [SQL] a strange order by behavior

2011-06-22 Thread Tom Lane
Samuel Gendler sgend...@ideasculptor.com writes: Interesting. The original thread to which I was referring has a subject of Sorting Issue and the original request showed a list of vehicle model names which were sorting as though there were no spaces. The user had collation set to en_US.UTF-8.

Re: [SQL] a strange order by behavior

2011-06-22 Thread Peter Eisentraut
On ons, 2011-06-22 at 01:43 -0700, Samuel Gendler wrote: I seem to recall a thread here about it ignoring spaces entirely in that collation (and maybe ignoring capitalization, too?). The way it works is that every collating element (letter or other character or character group that you sort as

Re: [SQL] a strange order by behavior

2011-06-22 Thread Peter Eisentraut
On ons, 2011-06-22 at 02:39 -0700, Samuel Gendler wrote: Pavel suggested using a collation of ucs_basic, but I get an error when I try that on linux: $ createdb -U u1 --lc-collate=ucs_basic -E UTF-8 test createdb: database creation failed: ERROR: invalid locale name ucs_basic ucs_basic

Re: [SQL] a strange order by behavior

2011-06-22 Thread Pavel Stehule
2011/6/22 Peter Eisentraut pete...@gmx.net: On ons, 2011-06-22 at 02:39 -0700, Samuel Gendler wrote: Pavel suggested using a collation of ucs_basic, but I get an error when I try that on linux: $ createdb -U u1 --lc-collate=ucs_basic -E UTF-8 test createdb: database creation failed: ERROR:  

Re: [SQL] a strange order by behavior

2011-06-22 Thread Samuel Gendler
On Wed, Jun 22, 2011 at 8:57 PM, Pavel Stehule pavel.steh...@gmail.comwrote: 2011/6/22 Peter Eisentraut pete...@gmx.net: On ons, 2011-06-22 at 02:39 -0700, Samuel Gendler wrote: Pavel suggested using a collation of ucs_basic, but I get an error when I try that on linux: $ createdb -U