Re: How to sort strings containing a dot? - Mailing list pgsql-general

From Steve Wampler
Subject Re: How to sort strings containing a dot?
Date
Msg-id 47E931B2.6090405@noao.edu
Whole thread Raw
In response to Re: How to sort strings containing a dot?  (Pierre LEBRECH <pierre.lebrech@laposte.net>)
List pgsql-general
Pierre LEBRECH wrote:
> But I have found a solution which works :
>
> select name from (select distinct name from t) as name order by replace(name, '.', 'a');

Shouldn't you replace '.' with a character whose collating sequence is strictly less than
'a'?  This solution looks to me as though it might not get ,e.g., 'coast' and 'co.st' in
the desired order except by chance.

--
Steve Wampler -- swampler@noao.edu
The gods that smiled on your birth are now laughing out loud.

pgsql-general by date:

Previous
From: "Anton Melser"
Date:
Subject: Re: Client-requested cast mode to emulate Pg8.2 on v8.3
Next
From: "Bill Wordsworth"
Date:
Subject: PostgreSQL, clusters and load-balance