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

Re: BUG #1517: SQL interval syntax is accepted by the parser,

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Roy Badami <roy(at)gnomon(dot)org(dot)uk>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #1517: SQL interval syntax is accepted by the parser,
Date: 2005-03-24 18:42:58
Message-ID: 804.1111689778@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> Agreed.  What is really weird is that the time is always displayed for a
> zero value:

> 	test=> select interval '0 years' year;
> 	 interval
> 	----------
> 	 00:00:00
> 	(1 row)

> but a non-zero shows the proper units:
	
> 	test=> select interval '1 years' year;
> 	 interval
> 	----------
> 	 1 year
> 	(1 row)

> Is that OK?

Well, it's a bit arbitrary, but I suppose it was done because otherwise
a zero interval would show nothing at all ...

			regards, tom lane

In response to

pgsql-bugs by date

Next:From: Tom LaneDate: 2005-03-24 19:22:22
Subject: Re: BUG #1552: massive performance hit between 7.4 and 8.0.1
Previous:From: Bruce MomjianDate: 2005-03-24 18:22:51
Subject: Re: BUG #1517: SQL interval syntax is accepted by the parser,

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