Skip site navigation (1) Skip section navigation (2)

Re: BUG #7498: Questionable interval parsing when in the form 'n m days'

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: daniel(at)heroku(dot)com
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #7498: Questionable interval parsing when in the form 'n m days'
Date: 2012-08-16 00:19:49
Message-ID: 26220.1345076389@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
daniel(at)heroku(dot)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


In response to

Responses

pgsql-bugs by date

Next:From: Bruce MomjianDate: 2012-08-16 00:31:07
Subject: Re: [BUGS] documentation bug - behave of NEW a OLD in plpgsql's triggers
Previous:From: Tom LaneDate: 2012-08-15 23:18:03
Subject: Re: Possible Bug in 9.2beta3

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group