Leonardo Frittelli ([EMAIL PROTECTED]) reports a bug with a severity of 3
The lower the number the more severe it is.

Short Description
Conversion errors for datetime fields

Long Description
I am currently using Postgresql version 7.0.2, but I did not find any reference to 
this problem in your bug/fix report for release 7.0.3.

I have noticed some conversion errors while using datetime/time fields with decimal 
values.
Here I send you two situations that I have been able to isolate.
I think that both are rounding errors.
I found these problems in Posgresql version 6.5.1 also, but it had been corrected in 
release 6.5.2. Now it has somehow reappeared.


Sample Code
-- Situation Nr 1
create table foo(
  my_date datetime
);
insert into foo values (now()::date+'0:00:59.999999999999999'::time);
select my_date from foo;

-- Output from psql
--CREATE
--INSERT 90665 1
--          my_date          
-----------------------------
-- 2000-12-28 00:01:60.00+00
--(1 row)
-- Note the '60 seconds' output

--------------------------------------------------------
-- Situation Nr 2

select '0:00:59.99999999999999'::time as fourteen_dec,
       '0:00:59.999999999999999'::time as fifteen_dec;

-- Output from psql
-- fourteen_dec | fifteen_dec 
----------------+-------------
-- 00:00:59     | 00:00:00
--(1 row)
-- Note that in the second case the result is rounded down instead of up



No file was uploaded with this report

Reply via email to