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-20 17:50:04
Message-ID: 8086.1111341004@sss.pgh.pa.us (view raw or flat)
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

pgsql-bugs by date

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

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