Re: Time problem again?
От
Bjørn T Johansen
Тема
Re: Time problem again?
Дата
Msg-id
1064867622.28501.37.camel@pennywise.havleik.no
Ответ на
Re: Time problem again? (Tom Lane)
Список
Дерево обсуждения
Time problem again? Bjørn T Johansen <btj@havleik.no>
Re: Time problem again? "Daniel Schuchardt" <daniel_schuchardt@web.de>
Re: Time problem again? Bjørn T Johansen <btj@havleik.no>
Re: Time problem again? Richard Huxton <dev@archonet.com>
Re: Time problem again? Bjørn T Johansen <btj@havleik.no>
Re: Time problem again? Richard Huxton <dev@archonet.com>
Re: Time problem again? Bjørn T Johansen <btj@havleik.no>
Re: Time problem again? Richard Huxton <dev@archonet.com>
Re: Time problem again? Bjørn T Johansen <btj@havleik.no>
Re: Time problem again? Richard Huxton <dev@archonet.com>
Re: Time problem again? Bjørn T Johansen <btj@havleik.no>
Re: Time problem again? Richard Huxton <dev@archonet.com>
Re: Time problem again? Bjørn T Johansen <btj@havleik.no>
Re: Time problem again? Richard Huxton <dev@archonet.com>
Re: Time problem again? Bjørn T Johansen <btj@havleik.no>
Re: Time problem again? Richard Huxton <dev@archonet.com>
Re: Time problem again? Bjørn T Johansen <btj@havleik.no>
Re: Time problem again? Karsten Hilbert <Karsten.Hilbert@gmx.net>
Re: Time problem again? Tom Lane <tgl@sss.pgh.pa.us>
Re: Time problem again? Bjørn T Johansen <btj@havleik.no>
Yes, it would be a lot easier... But I can't do that, because the time fields are default values; i.e. the time is the same every week but not the date...
BTJ
On Mon, 2003-09-29 at 21:38, Tom Lane wrote:
BTJ
On Mon, 2003-09-29 at 21:38, Tom Lane wrote:
Bjørn T Johansen <btj@havleik.no> writes: > But that was my initial question, "As far as I can tell, there is no way > to solve this without also supplying a date or am I missing something?" You could possibly do it without, using some logic like this: 1. compute MAX(time) - MIN(time) 2. if less than 12 hours, assume no midnight wraparound, sort by straight time. 3. if more than 12 hours, assume a wraparound, sort accordingly. But it seems a heck of a lot easier and less error-prone to store a full timestamp instead. What's your motivation for storing only time, anyway? Not space savings --- the time and timestamp types are both 8 bytes in PG. regards, tom lane
В списке pgsql-general по дате отправления
От: Joseph Shraibman
Дата: