> > Hmm, I happen to have a 6.5.0 system sitting here: It works there, so I suspect
> > something with your local operating system config.
It turns out to be a problem in the local country config :)
Why does the Netherlands (or at least my RH5.2 timezone database)
think you switch to DST on March 26? The date_part() function was just
masking the problem:
postgres=# select '3-27-2000'::timestamp-'3-6-2000'::timestamp;
postgres=# select '3-26-2000'::timestamp-'3-6-2000'::timestamp;
When you do the date arithmetic, you are automatically calculating an
*absolute* time difference which can be affected by DST boundaries.
For some reason, we don't have a date_part() available for the date
data type, which would have been my suggested workaround. We'd flame
the implementer, but that's me so I'll be nice :(
It is probably too late to get this added for v7.0, though I might be
able to add the code to the backend so it could be a (very) small
CREATE FUNCTION operation to get it usable for 7.0. Will look at it.
Thomas Lockhart lockhart(at)alumni(dot)caltech(dot)edu
South Pasadena, California
In response to
pgsql-hackers by date
|Next:||From: Maarten Boekhold||Date: 2000-03-31 15:38:03|
|Subject: Re: 6.5.0 datetime bug?|
|Previous:||From: Karel Zak||Date: 2000-03-31 15:33:29|
|Subject: procedure returns a tuple|