Skip site navigation (1) Skip section navigation (2)

Re: BUG #2387: Incorrect sorting of timestamp with time zone

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "" <christian(dot)koth(at)smiths-heimann(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2387: Incorrect sorting of timestamp with time zone
Date: 2006-04-11 20:06:19
Message-ID: 10097.1144785979@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
"" <christian(dot)koth(at)smiths-heimann(dot)com> writes:
> SELECT time_stamp, time_stamp_with_zone from timetest order by
> time_stamp_with_zone;

> I get the following result:
>      time_stamp      |  time_stamp_with_zone  
> ---------------------+------------------------
>  2006-09-23 20:01:00 | 2006-09-23 23:01:00+00 
>  2006-09-23 22:01:00 | 2006-09-24 00:01:00+00 
>  2006-09-23 21:01:00 | 2006-09-24 00:01:00+00 
>  2006-09-23 23:01:00 | 2006-09-24 01:01:00+00 
>  2006-09-24 00:01:00 | 2006-09-24 02:01:00+00 

> As one can see lines 2 and 3 are in the wrong order.

AFAICS, they are the same value, so they can be sorted in either order.
Which way they'll end up depends on undocumented properties of your
platform's qsort() routine.

			regards, tom lane

In response to

pgsql-bugs by date

Next:From: Tom LaneDate: 2006-04-11 20:11:01
Subject: Re: problem with kill script
Previous:From: Martin MarquesDate: 2006-04-11 19:34:43
Subject: BUG in logs

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group