Re: Storage sizes for dates/times (documentation bug?) - Mailing list pgsql-general

From Sam Mason
Subject Re: Storage sizes for dates/times (documentation bug?)
Date
Msg-id 20080415143835.GK6870@frubble.xen.chris-lamb.co.uk
Whole thread Raw
In response to Re: Storage sizes for dates/times (documentation bug?)  (Adrian Klaver <aklaver@comcast.net>)
List 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

pgsql-general by date:

Previous
From: Sam Mason
Date:
Subject: Re: Storage sizes for dates/times (documentation bug?)
Next
From: "Ferry, Craig"
Date:
Subject: precompilers