From: Tam Tran <trantamjp@gmail.com>
To: pgsql-bugs@postgresql.org
Subject: Re: BUG #7797: datetime + '1 month'::interval is going outside of a month's bounds
Date: Mon, 07 Jan 2013 09:54:44 -0800
Message-ID: <50EB0BE4.4070705@gmail.com> (raw)
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>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
On 1/7/2013 9:47 AM, Ryan Kelly wrote:
> 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
>
> ?
interval type comparison and timestamp type comparison. It's not the
same comparison.
> -Ryan Kelly
>
>
Tam
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
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: trantamjp@gmail.com
Subject: Re: BUG #7797: datetime + '1 month'::interval is going outside of a month's bounds
In-Reply-To: <50EB0BE4.4070705@gmail.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> <50EB0BE4.4070705@gmail.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