Re: Incorrect handling of timezones with extract
От | Tom Lane |
---|---|
Тема | Re: Incorrect handling of timezones with extract |
Дата | |
Msg-id | 24300.1363114880@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: Incorrect handling of timezones with extract (Josh Berkus <josh@agliodbs.com>) |
Ответы |
Re: Incorrect handling of timezones with extract
|
Список | pgsql-hackers |
Josh Berkus <josh@agliodbs.com> writes: >> and extract(day) from that gives -2 not -3. You could argue that this >> definition of timestamp subtraction isn't too consistent with the >> timestamp-plus-interval operator, and you'd be right; but I doubt we'd >> consider changing it now. > We specifically added that feature to support production calendaring > applications; I worked on it with Karel. When someone calendars a event > to be "3 days later" they don't expect it to jump by an hour because it > crossed a DST boundary. So changing it would break a bunch of people's > apps, especially mine. The behavior of timestamp-plus-interval is certainly supported by that argument, but I'm less convinced about timestamp-minus-timestamp. The raw result of the timestamp subtraction here is 71 hours (not the normal 72). Perhaps it should be outputting it that way instead of converting to "2 days 23 hours", which is arguably inaccurate. regards, tom lane
В списке pgsql-hackers по дате отправления: