Search Postgresql Archives

Interval "1 month" is equals to interval "30 days" - WHY?

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

 



Hello.

I've just discovered a very strange thing:

SELECT '1 mon'::interval = '30 days'::interval   --> TRUE???

This returns TRUE (also affected when I create an unique index using an interval column). Why?

I know that Postgres stores monthes, days and seconds in interval values separately. So how to make "=" to compare intervals "part-by-part" and not treat "1 mon" as "30 days"?

P.S.
Reproduced at least in 8.4 and 9.1.

[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