pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Marin D <marin@cybernet.bg>
To: pgsql-sql@postgresql.org
Subject: timespan weirdness (fwd)
Date: Tue, 2 Jun 1998 10:36:58 +0300 (EET DST)
Message-ID: <Pine.LNX.3.96.980602103644.6811E-100000@server.iclub.techno-link.com> (raw)



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? =-





Message-ID: <Pine.LNX.3.96.980602103644.6811E-100000@server.iclub.techno-link.com>
Permalink:  ../Pine.LNX.3.96.980602103644.6811E-100000@server.iclub.techno-link.com/
Also on:    postgresql.org/message-id/Pine.LNX.3.96.980602103644.6811E-100000@server.iclub.techno-link.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: marin@cybernet.bg
  Subject: Re: timespan weirdness (fwd)
  In-Reply-To: <Pine.LNX.3.96.980602103644.6811E-100000@server.iclub.techno-link.com>
  References: <Pine.LNX.3.96.980602103644.6811E-100000@server.iclub.techno-link.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox