Re: [GENERAL] Text to interval conversion can silently truncate data

2015-07-01 Thread Tom Lane
Jack Christensen writes: > 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 i

[GENERAL] Text to interval conversion can silently truncate data

2015-07-01 Thread Jack Christensen
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