pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: daniel@heroku.com
To: pgsql-bugs@postgresql.org
Subject: BUG #7498: Questionable interval parsing when in the form 'n m days'
Date: Wed, 15 Aug 2012 23:06:41 +0000
Message-ID: <E1T1mfh-0002ha-Rq@wrigleys.postgresql.org> (raw)

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 = '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;






view thread (3+ messages)  latest in thread

Message-ID: <E1T1mfh-0002ha-Rq@wrigleys.postgresql.org>
Permalink:  ../E1T1mfh-0002ha-Rq@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/E1T1mfh-0002ha-Rq@wrigleys.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: daniel@heroku.com
  Subject: Re: BUG #7498: Questionable interval parsing when in the form 'n m days'
  In-Reply-To: <E1T1mfh-0002ha-Rq@wrigleys.postgresql.org>
  References: <E1T1mfh-0002ha-Rq@wrigleys.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox