timespan weirdness (fwd) - Mailing list pgsql-sql

From Marin D
Subject timespan weirdness (fwd)
Date
Msg-id Pine.LNX.3.96.980602103644.6811E-100000@server.iclub.techno-link.com
Whole thread Raw
List pgsql-sql

Hi!

I need some help on the following timspan results:

create table test(d date);
insert into test values('1-5-98');    // European format

test=> select * from test;
         d
----------
01-05-1998
(1 row)


// this is OK

test=> select date(datetime(d) + '1 month'::timespan) from test;
      date
----------
01-06-1998
(1 row)


// this is OK

test=> select date(datetime(d) + '5 months'::timespan) from test;
      date
----------
01-10-1998
(1 row)


// Ooops!

test=> select date (datetime(d) + '6 months'::timespan) from test;
      date
----------
31-10-1998
(1 row)


// Ok too...

test=> select date (datetime(d) + '13 months'::timespan) from test;
      date
----------
01-06-1999
(1 row)


Any comments?

Than for your help!

    Marin



          -= Why do we need gates in a world without fences? =-



pgsql-sql by date:

Previous
From: Walt Bigelow
Date:
Subject: problem with the 'date' data type and msaccess95 :(
Next
From: Herouth Maoz
Date:
Subject: Re: [SQL] soundex more or less exact