Wrong sort-order

Started by Tarabasalmost 24 years ago2 messagesgeneral
Jump to latest
#1Tarabas
tarabas@tarabas.de

Hi!

Iam again having trouble with my postgresql ... when I do a
"select * from mytable order by username" then I get a result that's kinda
in the wrong order ...

It seems to make 2 different sorted blocks ... one starts with records that
start with "0...." sorted fom 0-Z and the other one comes directly after the
first one and starts with "_" again sorted from "_" - Z ... that is very odd
...

Does anyone have any idea what happened here ?! Any index or something i
have to recreate for the table ?!? I have 10293 in the table the column i
try to order by is varchar(255) and I use postgres 7.2.1 on RedHat Linux ...
i just "patched" the maximum arguments for functions to 64 instead of 16 ...

Greetings ... Manuel ...

#2Tarabas
tarabas@tarabas.de
In reply to: Tarabas (#1)
Re: Wrong sort-order

Ok it seems I can answer my question myself ... It's the UNIX-Style "order
by" which makes the difference here from ms-sql to postgresql ! ;o)

"select * from mytable order by lower(username)" does the job as wanted !
;o)

Greetings ... Manuel ...

-----------------------------
Hi!

Iam again having trouble with my postgresql ... when I do a
"select * from mytable order by username" then I get a result that's kinda
in the wrong order ...

It seems to make 2 different sorted blocks ... one starts with records that
start with "0...." sorted fom 0-Z and the other one comes directly after the
first one and starts with "_" again sorted from "_" - Z ... that is very odd
...

Does anyone have any idea what happened here ?! Any index or something i
have to recreate for the table ?!? I have 10293 in the table the column i
try to order by is varchar(255) and I use postgres 7.2.1 on RedHat Linux ...
i just "patched" the maximum arguments for functions to 64 instead of 16 ...

Greetings ... Manuel ...