Re: Storage sizes for dates/times (documentation bug?)

From: Sam Mason <sam(at)samason(dot)me(dot)uk>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Storage sizes for dates/times (documentation bug?)
Date: 2008-04-15 14:38:35
Message-ID: 20080415143835.GK6870@frubble.xen.chris-lamb.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Apr 15, 2008 at 06:48:27AM -0700, Adrian Klaver wrote:
> On Tuesday 15 April 2008 6:31 am, Sam Mason wrote:
> > My reasoning goes something like this: The WITH and WITHOUT clauses
> > seem to be the opposite of my naive understanding of their purpose. I'd
> > think that if you specify WITH TIME ZONE then it means that the timezone
> > is important to me, and I want to deal with it myself. Whereas, the
> > WITHOUT TIME ZONE clause would suggest that the timezone isn't important
> > to me, and anything the database can do to make the problem go away the
> > better. What the spec says, and PG does, is actually the opposite. The
> > fact that this confusion can occur (and seems to occur reasonably often
> > based on previous posts to the mailing lists) suggests that the docs
> > should highlight the differences more clearly.
> >
> > I'd also hazard a guess that we don't hear about it more because most
> > people just work within a single time zone and hence don't even notice
> > the difference between the two.
>
> My only comment is on this assertion. Any location that has DST rules has two
> time zones. For instance I live in US PST/PDT. Without timezone support
> doing date/time math across time zone boundaries is asking for problems.

Yes, knowing the difference between the two variants is needed to write
correct code.

In practise I'd guess that people don't do much testing across DST
changes and if they do the calcs are generally on the order of days
so an hour probably doesn't go amiss. The code will do all the right
things for them, but yes, it isn't correct.

Sam

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Dawid Kuroczko 2008-04-15 15:27:14 Which Python library - psycopg2 or pygresql?
Previous Message Ferry, Craig 2008-04-15 14:37:50 precompilers