Sorting problem - Mailing list pgsql-sql

From ruggero.maria.rossi@libero.it (Ruggero)
Subject Sorting problem
Date
Msg-id 3610e3e1.0407120027.2e04f948@posting.google.com
Whole thread Raw
Responses Re: Sorting problem
List pgsql-sql
Hi all,
I have a problem sorting varchar fields.
I will explain the problem with a simple example:

this query  select '##10' as sortfield  union  select '###1' as sortfield  order by sortfield
produces this correct output:  '###1'  '##10'

but this one
 select '##10############--------####79909999' as sortfield union select '###1############--------####79909999' as
sortfieldorder by sortfield
 
produces this wrong output:  '##10############--------####79909999'  '###1############--------####79909999'

I'm using postgresql 7.4.3 on Suse Linux 9.1.
I created my db using: initdb --pgdata=../data/ --encoding=LATIN1
--lc-collate=it_IT --lc-ctype=it_IT

Any suggestion?
Tia
Ruggero


pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: Problem in age on a dates interval
Next
From: "Sarah Tanembaum"
Date:
Subject: Re: [PHP] Secure DB Systems - How to