Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TsGuT-0000TZ-ND for pgsql-bugs@arkaria.postgresql.org; Mon, 07 Jan 2013 17:54:53 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1TsGuT-00054R-86 for pgsql-bugs@arkaria.postgresql.org; Mon, 07 Jan 2013 17:54:53 +0000 Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TsGuS-00054L-AC for pgsql-bugs@postgresql.org; Mon, 07 Jan 2013 17:54:52 +0000 Received: from mail-gg0-f172.google.com ([209.85.161.172]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TsGuQ-0006yd-1h for pgsql-bugs@postgresql.org; Mon, 07 Jan 2013 17:54:51 +0000 Received: by mail-gg0-f172.google.com with SMTP id r1so3046632ggn.3 for ; Mon, 07 Jan 2013 09:54:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=fVXloQUFKS7P8n6zONvpBjcfvQNDn7IuKOYvcmJfvPg=; b=w8yYgT1JVvyhxjH/cnL+NQLgzOKaKRmdewc4FrEDUg16znMzIS1ChorAAfvweYXPfW Wl8D5jVTXD2Lqs+NR9U4t494N5+CWRcaCiMuya+hbEgtxJW1ESbIdW7Y9ImE8JRhA2lP r4tkg6QspyFLLWZCJMCi0oaKqZLwwzlMxTQ3RnYMZ/hdtiaEn5q2P7bDJs547BNz+QwQ jwPQEAbGQ1Ehu7i/BlfqswjMTAH38yjSrPBRJVT7gedIosgGvVGCYBNYX2Rv41P/1x/I VPnna9wEIycaS4xnBaIB7gPRJqkX6vHftSX2NJ++lfDSitdKVTaDmZO/MX9evxZDpQUB zQ+Q== X-Received: by 10.236.147.174 with SMTP id t34mr69079216yhj.70.1357581289451; Mon, 07 Jan 2013 09:54:49 -0800 (PST) Received: from [10.120.88.164] (wsip-98-189-21-254.oc.oc.cox.net. [98.189.21.254]) by mx.google.com with ESMTPS id w2sm67815196yhk.8.2013.01.07.09.54.47 (version=SSLv3 cipher=OTHER); Mon, 07 Jan 2013 09:54:48 -0800 (PST) Message-ID: <50EB0BE4.4070705@gmail.com> Date: Mon, 07 Jan 2013 09:54:44 -0800 From: Tam Tran User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: pgsql-bugs@postgresql.org Subject: Re: BUG #7797: datetime + '1 month'::interval is going outside of a month's bounds References: <20130107171915.GA18868@llserver.lakeliving.com> <20130107174726.GB18868@llserver.lakeliving.com> In-Reply-To: <20130107174726.GB18868@llserver.lakeliving.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org 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 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