to_char() and order-by

From: jboes(at)nexcerpt(dot)com (Jeff Boes)
To: pgsql-sql(at)postgresql(dot)org
Subject: to_char() and order-by
Date: 2002-06-27 19:27:11
Message-ID: d40a65a1.0206271127.45c44b7d@posting.google.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Perhaps this was covered in the 7.2.x release notes, but it's mystifying us:

select to_char(time_link,'999.99') from stat_fetch
where time_link is not null
order by 1 desc limit 10;

(time_link is a double-precision column.) Under 7.1.3, this returns results like:

to_char
---------
9.99
9.99
9.99
9.99
9.99
9.99
9.99
9.99
9.99
9.99
(10 rows)

while under 7.2.1, you get the top 10 rows in *numerical* order:

to_char
---------
278.78
261.07
240.25
180.24
173.26
160.35
159.02
144.57
134.21
131.66
(10 rows)

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message David Secret 2002-06-27 19:34:35 Unsubscription -- How?
Previous Message Dennis Kaarsemaker 2002-06-27 19:15:10 Re: Calculating with sql