Skip site navigation (1) Skip section navigation (2)

Re: Time problem again?

From: Bjørn T Johansen <btj(at)havleik(dot)no>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Richard Huxton <dev(at)archonet(dot)com>,Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Time problem again?
Date: 2003-09-29 20:33:42
Message-ID: 1064867622.28501.37.camel@pennywise.havleik.no (view raw or flat)
Thread:
Lists: pgsql-general
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:

> =?ISO-8859-1?Q?Bj=F8rn?= T Johansen <btj(at)havleik(dot)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

In response to

pgsql-general by date

Next:From: RelaxinDate: 2003-09-29 20:35:27
Subject: Re: FUD!! ODBC will not be supported by Microsoft in the future
Previous:From: Bjørn T JohansenDate: 2003-09-29 20:31:31
Subject: Re: Time problem again?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group