Re: bug in date_part() function in 6.5.2, 7.0.2

Поиск
Список
Период
Сортировка
От Thomas Lockhart
Тема Re: bug in date_part() function in 6.5.2, 7.0.2
Дата
Msg-id 39B8F97F.E94ED8C3@alumni.caltech.edu
обсуждение исходный текст
Ответ на Re: bug in date_part() function in 6.5.2, 7.0.2  (Karel Zak <zakkr@zf.jcu.cz>)
Список pgsql-bugs
> Seems like you could just skip step 3 and call localtime() with fields
> indicating midnight of the specified date.  Then use the complete
> localtime result (don't discard any fields) and you should be OK, no?

OK, I have a solution which involves mktime(). As a side effect, I've
stripped some code, so date and date,time to timestamp conversions no
longer have to run through a complete conversion via a tm structure.
Things should be faster (unless mktime() is substantially slower than
the other support routines). btw, the date/timetz to timestamp
conversion routine has shrunk down to one line since it turns out all
required fields were already available :)

Regression tests pass (which I guess tells me that they need some added
cases, since they passed before too); will commit sometime soon.

                     - Thomas

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: bug in date_part() function in 6.5.2, 7.0.2
Следующее
От: pgsql-bugs@postgresql.org
Дата:
Сообщение: createuser fails