Doug McNaught <[EMAIL PROTECTED]> writes: > template1=# select '1 year'::interval = '360 days'::interval; > ?column? > ---------- > t > (1 row)
Yeah, if you look at interval_cmp_internal() it's fairly obvious why. I think that this definition is probably bogus, and that only intervals that match exactly (equal months parts *and* equal seconds parts) should be considered "equal". However the most obvious way to redefine it (compare the months, and only if equal compare the seconds) would lead to rather nonintuitive behaviors such as "'1 year' > '1000 days'". Anybody have any thoughts about a better way to map the multicomponent reality into a one-dimensional sorting order? (Note also that as Bruno was just mentioning, we really ought to have months/days/seconds components, not just months/seconds; which makes the comparison issue even more interesting.) regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])