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

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(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:22:51
Message-ID: 200503241822.j2OIMpi23984@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Tom Lane wrote:
> Roy Badami <roy(at)gnomon(dot)org(dot)uk> writes:
> > test=> select interval '1 hour 1 minute';
> > interval
> > ----------
> > 01:01:00
> > (1 row)
>
> > Hmm, I don't think I really like having a seconds field in the output,
> > given that the column is by definition only storing data to a
> > precision of a minute.
>
> Leaving out the seconds would make the display ambiguous.

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?

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2005-03-24 18:42:58 Re: BUG #1517: SQL interval syntax is accepted by the parser,
Previous Message Ingolf Knopf 2005-03-24 15:31:37 BUG #1561: wrong detection of number of parameters in java.sql.PreparedStatement