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

From: Roy Badami <roy(at)gnomon(dot)org(dot)uk>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Roy Badami <roy(at)gnomon(dot)org(dot)uk>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #1517: SQL interval syntax is accepted by the parser,
Date: 2005-03-20 14:44:15
Message-ID: 16957.35903.590223.328021@giles.gnomon.org.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Bruce> I guess my point is that we should allow:

Bruce> select interval '1' day '1' hour

Bruce> as SQL standard and equavalent to:

Ah, I think you're misunderstanding what the SQL standard interval
literal syntax looks like.

It would be

INTERVAL '1 1' DAY TO HOUR

Essentially the full syntax for a day-time interval is

INTERVAL '1 2:03:04' DAY TO SECOND

and the full syntax of a year-month interval is

INTERVA: '1-2' YEAR TO MONTH

but if you use a more restricted interval type you omit the fields
that aren't present in your interval type.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Roy Badami 2005-03-20 15:46:50 Re: BUG #1517: SQL interval syntax is accepted by the parser,
Previous Message Bruce Momjian 2005-03-20 14:39:15 Re: BUG #1517: SQL interval syntax is accepted by the parser,