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-20 17:50:04
Message-ID: 8086.1111341004@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> I guess my point is that we should allow:

> select interval '1' day '1' hour

> as SQL standard

Where do you get that that's in the SQL standard?

What is in the standard is

<interval literal> ::=
INTERVAL [ <sign> ] <interval string> <interval qualifier>

<interval string> ::=
<quote> { <year-month literal> | <day-time literal> } <quote>

<interval qualifier> ::=
<start field> TO <end field>
| <single datetime field>

<interval qualifier> is defined in SQL92 10.1 --- I won't repeat the
whole BNF for it because it's tedious, but the point here is that you
get *one* string and *one* qualifier, in that order.

(I notice that we don't have the <sign> accounted for yet, btw, but
the rest of the syntax seems to be up to speed.)

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2005-03-20 17:53:33 Re: BUG #1517: SQL interval syntax is accepted by the parser,
Previous Message Tom Lane 2005-03-20 17:44:46 Re: BUG #1517: SQL interval syntax is accepted by the parser,