pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ryan Kelly <rpkelly22@gmail.com>
To: Daniele Varrazzo <daniele.varrazzo@gmail.com>
Cc: afonit@gmail.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #7797: datetime + '1 month'::interval is going outside of a month's bounds
Date: Mon, 7 Jan 2013 12:47:26 -0500
Message-ID: <20130107174726.GB18868@llserver.lakeliving.com> (raw)
In-Reply-To: <CA+mi_8bbtcvG6n9gm7EAnh5KNb=nJMjqg8prn=DhzLh0RX5Acw@mail.gmail.com>
References: <E1TsDhv-00040y-0S@wrigleys.postgresql.org>
	<20130107171915.GA18868@llserver.lakeliving.com>
	<CA+mi_8bbtcvG6n9gm7EAnh5KNb=nJMjqg8prn=DhzLh0RX5Acw@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

On Mon, Jan 01/07/13, 2013 at 05:42:40PM +0000, Daniele Varrazzo wrote:
> On Mon, Jan 7, 2013 at 5:19 PM, Ryan Kelly <rpkelly22@gmail.com> wrote:
> 
> > '1 month'::interval is the same as '30 days'::interval.
> 
> No, it's not.
> 
> # select '2012-07-31'::date + '1 month'::interval, '2012-07-31'::date
> + '30 days'::interval;
>       ?column?       |      ?column?
> ---------------------+---------------------
>  2012-08-31 00:00:00 | 2012-08-30 00:00:00
> 
> -- Daniele

Alright, now I'm thoroughly confused. What magic makes this true:

# select '30 days'::interval = '1 month'::interval;
 ?column? 
----------
 t

But not this:

# select '2012-07-31'::timestamp + '1 month'::interval = '2012-07-31'::timestamp + '30 days'::interval;
 ?column? 
----------
 f

?

-Ryan Kelly


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (9+ messages)  latest in thread

Message-ID: <20130107174726.GB18868@llserver.lakeliving.com>
Permalink:  ../20130107174726.GB18868@llserver.lakeliving.com/
Also on:    postgresql.org/message-id/20130107174726.GB18868@llserver.lakeliving.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-bugs@postgresql.org
  Cc: rpkelly22@gmail.com, daniele.varrazzo@gmail.com, afonit@gmail.com
  Subject: Re: BUG #7797: datetime + '1 month'::interval is going outside of a month's bounds
  In-Reply-To: <20130107174726.GB18868@llserver.lakeliving.com>
  References: <E1TsDhv-00040y-0S@wrigleys.postgresql.org> <20130107171915.GA18868@llserver.lakeliving.com> <CA+mi_8bbtcvG6n9gm7EAnh5KNb=nJMjqg8prn=DhzLh0RX5Acw@mail.gmail.com> <20130107174726.GB18868@llserver.lakeliving.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