Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TsH6B-0000nV-HD for pgsql-bugs@arkaria.postgresql.org; Mon, 07 Jan 2013 18:06:59 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1TsH6B-00078d-1w for pgsql-bugs@arkaria.postgresql.org; Mon, 07 Jan 2013 18:06:59 +0000 Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TsH6A-00078Y-F9 for pgsql-bugs@postgresql.org; Mon, 07 Jan 2013 18:06:58 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TsH69-0007C6-H4 for pgsql-bugs@postgresql.org; Mon, 07 Jan 2013 18:06:57 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id r07I6u5q013443; Mon, 7 Jan 2013 13:06:56 -0500 (EST) From: Tom Lane To: Ryan Kelly cc: Daniele Varrazzo , afonit@gmail.com, pgsql-bugs@postgresql.org 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: <20130107171915.GA18868@llserver.lakeliving.com> <20130107174726.GB18868@llserver.lakeliving.com> Comments: In-reply-to Ryan Kelly message dated "Mon, 07 Jan 2013 12:47:26 -0500" Date: Mon, 07 Jan 2013 13:06:55 -0500 Message-ID: <13442.1357582015@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) 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 Ryan Kelly writes: > 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. > Alright, now I'm thoroughly confused. What magic makes this true: > # select '30 days'::interval = '1 month'::interval; > ?column? > ---------- > t '1 month' and '30 days' are distinct concepts. Some operations will treat them as equal, if there is no additional info that will nail down the actual length of the particular month in question. Or if you like, 30 days is the "default" length of a month. A related point is that the interval equality operator will say that '24 hours' and '1 day' are equal, even though they aren't the same thing --- there are cases where they behave differently, when working near a DST transition time. There might be some use for an interval "identity" operator, which would only say true for completely-indistinguishable interval values; but we don't have one. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs