Re: PostgreSQL 7.0.2 Date Miscalculation

From: "Jay Guerette" <JayGuerette(at)pobox(dot)com>
To: jclift(at)iprimus(dot)com(dot)au
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: PostgreSQL 7.0.2 Date Miscalculation
Date: 2001-04-07 13:59:48
Message-ID: 3164.10.0.0.17.986651988.squirrel@mail.guerette.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


Justin,

I am using the Redhat 7.0 distribution, updated with a 2.2.18 kernel.

> Hi Jay,
>
> Which OS are you using? Mandrake-Linux 7.2 is known to have bugs in
> the version of PostgreSQL they supply as RPM's.
>
> Regards and best wishes,
>
> Justin Clift
>
> pgsql-bugs(at)postgresql(dot)org wrote:
>>
>> Jay Guerette (JayGuerette(at)pobox(dot)com) reports a bug with a severity of
>> 2 The lower the number the more severe it is.
>>
>> Short Description
>> PostgreSQL 7.0.2 Date Miscalculation
>>
>> Long Description
>> PostgreSQL 7.0.2
>>
>> The RELTIME function is miscalculating dates.
>> (all my graphs were wrong today!)
>>
>> Sample Code
>> The query:
>>
>> SELECT STAMP FROM SYSLOG WHERE DATE(STAMP)=DATE(TIMESTAMP('TODAY'-'1
>> WEEK'::RELTIME)) LIMIT 1;
>>
>> Produces:
>>
>> stamp
>> ------------------------
>> 2001-03-25 02:53:52-05
>> (1 row)
>>
>> When the date is:
>>
>> Mon Apr 2 19:45:40 EDT 2001
>>
>> And the result SHOULD be:
>>
>> stamp
>> ------------------------
>> 2001-03-26 02:53:52-05
>>
>> I also have NO idea what this means:
>>
>> SELECT DATE(CURRENT_DATE - ('1 WEEK'::RELTIME));
>> date
>> ------------
>> 0345-05-14
>> (1 row)
>>
>> No file was uploaded with this report
>>
>> ---------------------------(end of
>> broadcast)--------------------------- TIP 4: Don't 'kill -9' the
>> postmaster
>
> --
> "My grandfather once told me that there are two kinds of people: those
> who work and those who take the credit. He told me to try to be in the
> first group; there was less competition there."
> - Indira Gandhi

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Stephan Szabo 2001-04-08 07:20:10 Re: error creating table that worked under 7.0.3
Previous Message Ken-ichi Yamasaki 2001-04-07 09:33:36 Numeric modulo operator is incorrect.