Re: Convert TimeStamp to Date
От | shuai@objectwareinc.com |
---|---|
Тема | Re: Convert TimeStamp to Date |
Дата | |
Msg-id | 23332581400063@UTIL.objectwareinc.com обсуждение исходный текст |
Ответ на | Convert TimeStamp to Date ("shuai@objectwareinc.com" <shuai@objectwareinc.com>) |
Список | pgsql-general |
>Yep ... looks like it got broken in >7.3. >7.2.4 works fine, but 7.3 (and CVS tip) >doesn't. >This is because in 7.2, timestamp_date >() and timestamptz_date () do the >same thing - >convert the time to Julian date and >then subtruct the offset for Y2K, >and both work. >In 7.3 (and 7.4) timestamptz_date () is >still doing that (and select >'1999-12-31 >00:00:01'::timestamptz::date still >works), >*but* timestamp_date() is changed for >some reason to just divide the >timestamp by the number of microseconds >per day, that is obviously wrong >for the case when ts is negative >(before 2000) because integer division >(unlike floor ()) truncates towards >zero... Thank you and everybody else. This explains it. But still, is there a solution other than casting a timestamp to timestamptz and then to date? Because I major concern is performance.(and I probably can't change to another version) Thanks. LS
В списке pgsql-general по дате отправления: