Bruce Momjian <pgman@candle.pha.pa.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