problem with ORDER BY - Mailing list pgsql-general

From Nicolas KOWALSKI
Subject problem with ORDER BY
Date
Msg-id 873asd7zzk.fsf@petole.dyndns.org
Whole thread Raw
Responses Re: problem with ORDER BY
List pgsql-general
Hello,

I do not understand why the following ORDER BY statment does not work
as I would expect:

1) I defined a simple table with only one column, containing urls:

mon=> \d url
    Table "public.url"
 Column | Type | Modifiers
--------+------+-----------
 url    | text | not null
Indexes:
    "url_pkey" primary key, btree (url)


2) I populated it, some urls starting with https, others with http

3) When I want to sort them, I get this "strange" ordering:

mon=> SELECT * FROM url ORDER BY url asc ;
              url
-------------------------------
 http://imag.fr/
 https://gmail.com/
 https://mail.google.com/mail/
 https://www.sixxs.net/
 http://www.google.com/
 http://www.google.com/reader/
 http://www.google.fr/
 http://www.postgresql.org/
(8 rows)


Should'nt I get these values in the following order ?

 http://imag.fr/
 http://www.google.com/
 http://www.google.com/reader/
 http://www.google.fr/
 http://www.postgresql.org/
 https://gmail.com/
 https://mail.google.com/mail/
 https://www.sixxs.net/


Thanks,
--
Nicolas

pgsql-general by date:

Previous
From: Stefan Schwarzer
Date:
Subject: Re: Dump schema without the functions
Next
From: Martijn van Oosterhout
Date:
Subject: Re: problem with ORDER BY