Search Postgresql Archives

Text to interval conversion can silently truncate data

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

 



jack=# select '1.51 years'::interval = '1.52 years'::interval;
 ?column?
----------
 t
(1 row)

This is surprising. Once I looked at the C code for Interval it makes more sense given that it cannot represent fractional years, months, or days. Wouldn't it make more sense to raise an invalid input error than to silently truncate data?

Jack


[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