Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TsGnP-0000LJ-Ag for pgsql-bugs@arkaria.postgresql.org; Mon, 07 Jan 2013 17:47:35 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1TsGnO-0004C5-Rp for pgsql-bugs@arkaria.postgresql.org; Mon, 07 Jan 2013 17:47:34 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TsGnO-0004C0-Al for pgsql-bugs@postgresql.org; Mon, 07 Jan 2013 17:47:34 +0000 Received: from mail-ia0-f181.google.com ([209.85.210.181]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TsGnM-0001Nc-4z for pgsql-bugs@postgresql.org; Mon, 07 Jan 2013 17:47:33 +0000 Received: by mail-ia0-f181.google.com with SMTP id s32so16345492iak.40 for ; Mon, 07 Jan 2013 09:47:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=wValznmdYvXjMzCtEag5FJi8ODwVrPAgPjSAtwj3uyI=; b=iY74ePTC4gknKVqKE2YjA54dv909H0QmPC6ftByODulKjqEmgiBDljgb/+lSO9dNiw szMbXOM7K8gRzUB8T/03onAS3h4l8clPuuknfrQWh9RzbCN7k/mhIysvvXioa/V/uWEh lfMCzYz4p+NEGWWSUFx4InRPkAHWlS4LO6j06R2qWX4QCuHJzXhDV5tU68oatRrmhN3f VeCAEOSf1xKqH+D5WtxSYjuZR6z8bM0nj4gaUY9L/o6xU8JgKjloAgPcRxbHqoPeot1J 5+RTJx+1A4cFTfKSfp5iI7greGINM7rRmBm3QYy1yVlpl0NBujV6s6+1/GPS025R4irF FSfA== X-Received: by 10.50.53.230 with SMTP id e6mr6019023igp.46.1357580851135; Mon, 07 Jan 2013 09:47:31 -0800 (PST) Received: from llserver.lakeliving.com (ool-18bbd2c6.static.optonline.net. [24.187.210.198]) by mx.google.com with ESMTPS id gs6sm8087622igc.11.2013.01.07.09.47.29 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 07 Jan 2013 09:47:30 -0800 (PST) Date: Mon, 7 Jan 2013 12:47:26 -0500 From: Ryan Kelly To: Daniele Varrazzo Cc: afonit@gmail.com, pgsql-bugs@postgresql.org Subject: Re: BUG #7797: datetime + '1 month'::interval is going outside of a month's bounds Message-ID: <20130107174726.GB18868@llserver.lakeliving.com> References: <20130107171915.GA18868@llserver.lakeliving.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-Pg-Spam-Score: -2.5 (--) 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 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 ? -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