Re: BUG #1179: Time comparison fail - Mailing list pgsql-bugs

From Mauricio CASTRO
Subject Re: BUG #1179: Time comparison fail
Date
Msg-id BAY18-F95z3tAFxZSHG0000d170@hotmail.com
Whole thread Raw
In response to BUG #1179: Time comparison fail  ("PostgreSQL Bugs List" <pgsql-bugs@postgresql.org>)
List pgsql-bugs
You are right!

I am doing something wrong? I understand that there is a difference but I
don't know why.

mex2=# select
mex2-#   age(endeddatetime,starteddatetime),
mex2-#   time,
mex2-#   date_part('second',(age(endeddatetime,starteddatetime)))*1000,
mex2-#   date_part('second',(age(endeddatetime,starteddatetime)))*1000-time
as Must_be_Zero,
mex2-#   date_part('second',((starteddatetime)))*1000 as starteddatetime_s,
mex2-#   date_part('second',((endeddatetime)))*1000 as endeddatetime_s,
mex2-#   starteddatetime,
mex2-#   endeddatetime
mex2-#   from entry where  not
date_part('second',(age(endeddatetime,starteddatetime)))*1000=time;
     age      | time | ?column? |     must_be_zero      | starteddatetime_s
| endeddatetime_s |      starteddatetime       |       endeddatetime

--------------+------+----------+-----------------------+-------------------+-----------------+----------------------------+----------------------------
00:00:04.031 | 4031 |     4031 | -4.54747350886464e-13 |             51171 |
           55202 | 2004-05-10 12:47:51.171-05 | 2004-05-10 12:47:55.202-05
00:00:04.094 | 4094 |     4094 |  4.54747350886464e-13 |             51171 |
           55265 | 2004-05-10 12:47:51.171-05 | 2004-05-10 12:47:55.265-05
00:00:04.047 | 4047 |     4047 | -4.54747350886464e-13 |             32781 |
           36828 | 2004-05-10 12:50:32.781-05 | 2004-05-10 12:50:36.828-05
00:00:02.047 | 2047 |     2047 |  2.27373675443232e-13 |             54171 |
           56218 | 2004-05-10 14:10:54.171-05 | 2004-05-10 14:10:56.218-05
00:00:04.046 | 4046 |     4046 |  4.54747350886464e-13 |              5312 |
            9358 | 2004-05-10 14:13:05.312-05 | 2004-05-10 14:13:09.358-05
(5 rows)

_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE*
http://join.msn.com/?page=features/junkmail

pgsql-bugs by date:

Previous
From: Joe Carlson
Date:
Subject: Re: BUG #1175: insert rule action with defaults
Next
From: Tom Lane
Date:
Subject: Re: BUG #1184: listeners not cleaned on crash