Re: possible time change issue - known problem?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Dan Langille" <dan(at)langille(dot)org>
Cc: Martijn van Oosterhout <kleptog(at)svana(dot)org>, pgsql-general(at)postgresql(dot)org
Subject: Re: possible time change issue - known problem?
Date: 2003-04-07 14:50:26
Message-ID: 28114.1049727026@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Dan Langille" <dan(at)langille(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michal Taborsky 2003-04-07 15:16:25 CREATE USER within function
Previous Message Jürgen Hauser 2003-04-07 14:41:31 Re: Enum in PostgreSQL - How to