Search Postgresql Archives

problem with ORDER BY

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux