Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T1mfj-0003cX-PC for pgsql-bugs@postgresql.org; Wed, 15 Aug 2012 23:06:43 +0000 Received: from mahout.postgresql.org ([98.129.198.123]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T1mfi-0003op-Kd for pgsql-bugs@postgresql.org; Wed, 15 Aug 2012 23:06:43 +0000 Received: from [204.145.124.246] (helo=wrigleys.postgresql.org) by mahout.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T1mfi-0005f4-67 for pgsql-bugs@postgresql.org; Wed, 15 Aug 2012 23:06:42 +0000 Received: from www-data by wrigleys.postgresql.org with local (Exim 4.72) (envelope-from ) id 1T1mfh-0002ha-Rq for pgsql-bugs@postgresql.org; Wed, 15 Aug 2012 23:06:41 +0000 Date: Wed, 15 Aug 2012 23:06:41 +0000 Message-Id: Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: BUG #7498: Questionable interval parsing when in the form 'n m days' To: pgsql-bugs@postgresql.org From: daniel@heroku.com X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201208/114 X-Sequence-Number: 33838 The following bug has been logged on the website: Bug reference: 7498 Logged by: Daniel Farina Email address: daniel@heroku.com PostgreSQL version: 9.1.4 Operating system: Ubuntu 12.04 Description: = This is an expression that should probably have an error and not evaluate to "true": select '1 5 hours'::interval =3D '1 day 5 hours'::interval; ?column? = ---------- t (1 row) I think that the first spelling, a unit-less '1', should not be accepted. = Other unit combinations agree: select '1 5 minutes'::interval; ERROR: invalid input syntax for type interval: "1 5 minutes" LINE 1: select '1 5 minutes'::interval; ^ select '1 5 months'::interval; ERROR: invalid input syntax for type interval: "1 5 months" LINE 1: select '1 5 months'::interval; ^ select '1 5 seconds'::interval; ERROR: invalid input syntax for type interval: "1 5 seconds" LINE 1: select '1 5 seconds'::interval;