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;