Re: [HACKERS] Interval arithmetic should emit interval in canonical format

2014-07-15 Thread Tom Lane
Gurjeet Singh writes: > The interval arithmetic operations may also yield non-canonical > values, and IMHO the 'interval op interval' or 'interval op scalar' > expressions should yield an interval in canonical form. You're mistaken. > postgres=# select '6 days 00:16:00'::interval - '5 days > 23:

[HACKERS] Interval arithmetic should emit interval in canonical format

2014-07-15 Thread Gurjeet Singh
It's hard to argue that the current behaviour is wrong, but it's worth a try. First I'd appreciate the "official" reasons why Postgres prefers to keep interval values in non-canonical form, like '1 day -23:37:00' instead of '00:23:00'. I understand it has something to do with a year/month/day not