Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T1noX-0002Fd-UZ for pgsql-bugs@postgresql.org; Thu, 16 Aug 2012 00:19:54 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T1noW-0004lE-7r for pgsql-bugs@postgresql.org; Thu, 16 Aug 2012 00:19:53 +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 q7G0JoiC026221; Wed, 15 Aug 2012 20:19:50 -0400 (EDT) From: Tom Lane To: daniel@heroku.com cc: pgsql-bugs@postgresql.org Subject: Re: BUG #7498: Questionable interval parsing when in the form 'n m days' In-reply-to: References: Comments: In-reply-to daniel@heroku.com message dated "Wed, 15 Aug 2012 23:06:41 -0000" Date: Wed, 15 Aug 2012 20:19:49 -0400 Message-ID: <26220.1345076389@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201208/116 X-Sequence-Number: 33840 daniel@heroku.com writes: > select '1 5 hours'::interval = '1 day 5 hours'::interval; > ?column? > ---------- > t > (1 row) > I think that the first spelling, a unit-less '1', should not be accepted. Not sure I agree. The syntax '1 05:00' is required by spec to mean '1 day 5 hours 0 minutes'. I would take that to mean that a unitless number directly to the left of an hours field is days. Anyway, the code in DecodeInterval is treating these cases the same. regards, tom lane