Re: date_trunc problem in HEAD
От | Kurt Roeckx |
---|---|
Тема | Re: date_trunc problem in HEAD |
Дата | |
Msg-id | 20050313235437.GA8835@roeckx.be обсуждение исходный текст |
Ответ на | Re: date_trunc problem in HEAD (Robert Creager <Robert_Creager@LogicalChaos.org>) |
Список | pgsql-hackers |
On Sun, Mar 13, 2005 at 12:48:00PM -0700, Robert Creager wrote: > When grilled further on (Sun, 13 Mar 2005 19:40:02 +0100), > Kurt Roeckx <kurt@roeckx.be> confessed: > > > > Attached is a patch against HEAD for your review. > > > > It has this comment in it: > > /* the new year cannot be greater than the > > * original year, so we subtract one if it is > > > > Not doing to well here. When will the ISO year be greater than the current > year? But, what I did is incorrect and 2006-01-01 shows the next problem date: The iso year can be greater than the current year at the end of the year and smaller on the start of the year. You have either of those at every year change. > SELECT '' AS date_trunc_week, date_trunc( 'week', timestamp '2006-01-01' ) AS > week_trunc; > > date_trunc_week | week_trunc > -----------------+--------------------- > | 2006-12-25 00:00:00 I expected 2005-12-26 here. > SELECT '' AS date_trunc_week, date_trunc( 'week', timestamp '2005-01-01' ) AS > week_trunc; > date_trunc_week | week_trunc > -----------------+--------------------- > | 2005-01-02 00:00:00 That's a higher date, and obviouly looks wrong. Here I expected 2004-12-27 > The date should be 2005-01-03. Sigh. Maybe I should of just submitted a bug > report about it... That's the next week, and not what I would expect to get as result. Kurt
В списке pgsql-hackers по дате отправления: