Re: possible time change issue - known problem? - Mailing list pgsql-general

From Tom Lane
Subject Re: possible time change issue - known problem?
Date
Msg-id 28114.1049727026@sss.pgh.pa.us
Whole thread Raw
In response to Re: possible time change issue - known problem?  ("Dan Langille" <dan@langille.org>)
Responses Re: possible time change issue - known problem?
List pgsql-general
"Dan Langille" <dan@langille.org> writes:
> On 7 Apr 2003 at 10:32, Tom Lane wrote:
>> Type INTERVAL knows about months and seconds, nothing else.

> Hmmm, months and seconds only.   Then is the documentation wrong?

No, the docs are right, but the physical storage is months and seconds.
For instance, '1 year' becomes '12 months' (okay) and '1 week' becomes
'604800 seconds' (not so okay).  Adding 'day' as a basic element would
allow correct handling of cross-DST-boundary cases.

>> I've opined in the past that it should be months, days, and seconds,
>> but no one seems excited enough about the issue to do the nontrivial
>> work involved ...

> If it truly is that trivial, please point me at the file I need to
> hack.

Didn't I just say that I think it's *not* trivial?  But anyway, the
interval-related functions are in some subset of

src/backend/utils/adt/date.c
src/backend/utils/adt/datetime.c
src/backend/utils/adt/nabstime.c
src/backend/utils/adt/timestamp.c
and see also their header files
src/include/utils/date.h
src/include/utils/datetime.h
src/include/utils/nabstime.h
src/include/utils/timestamp.h

There are several datatypes implemented in those files, but their
interconnections are spaghetti-ish enough that you'll probably have
to look through all the code before you start hacking.

            regards, tom lane


pgsql-general by date:

Previous
From: "Dan Langille"
Date:
Subject: Re: possible time change issue - known problem?
Next
From: Dennis Gearon
Date:
Subject: Re: chron scripts and pgsql