problem with ORDER BY

From: Nicolas KOWALSKI <niko(at)petole(dot)dyndns(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: problem with ORDER BY
Date: 2008-02-01 10:06:07
Message-ID: 873asd7zzk.fsf@petole.dyndns.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2008-02-01 10:20:06 Re: problem with ORDER BY
Previous Message Stefan Schwarzer 2008-02-01 07:31:28 Re: Dump schema without the functions