Re: timestamp with time zone a la sql99

From: Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>
To: Dennis Bjorklund <db(at)zigo(dot)dhs(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: timestamp with time zone a la sql99
Date: 2004-10-22 12:37:33
Message-ID: 200410220837.33886.xzilla@users.sourceforge.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thursday 21 October 2004 11:01, Dennis Bjorklund wrote:
> On Thu, 21 Oct 2004, Tom Lane wrote:
> > I'm aware that there are aspects of the spec behavior that appear to
> > require that, but is it really an improvement over the implementation
> > we have?
>
> Improvement and improvement. The actual time value is of course the same
> (the utc part of a timestamp) and the only thing extra you get is that the
> time zone is stored. The extra information you do have now, when stored in
> this way, is that you store both a utc time and a local time. Will any
> application ever need that? Who knows? I think it makes sense and is an
> easier model to think about then what pg uses today. So I would use it
> even if it means using 2 bytes more storage then what timestamptz do
>

In a fit of early morning, pre-coffee thoughts, I'm thinking this might be
just what I've been looking for. In one of my apps we take calls from around
the country for customers and store the time that call came in. Unfortunately
we need to know things like how many calls did we take in an hour across
customers, but also how many calls did we take at 6AM local time to the
customer. The way PostgreSQL works now, you have to store some extra bits
of info in another column and then reassemble it to be able to determine
those two queries, but it sounds like your timestampstdtz would allow that
information to be stored together, as it should be.

--
Robert Treat
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Treat 2004-10-22 12:41:58 Re: Postresql 8.0 Beta 3 - SELECT ... FOR UPDATE
Previous Message Dominic Mitchell 2004-10-22 11:53:03 Re: Should libpq set close-on-exec flag on its socket?