Roy Badami wrote:
>     Bruce>    select interval day to second '1 day 1 hour'
> 
>     Bruce> However, we don't support that syntax, only the one with
>     Bruce> the specification after.
> 
> Is that valid ANSI SQL? 

I guess my point is that we should allow:

        select interval '1' day '1' hour

as SQL standard and equavalent to:

        select interval '1 day 1 hour'

and if we need to specify the data type we would add it before
the data value:

        select interval day to second '1' day '1' hour

I see no way to support the SQL syntax and allow the data type
specification after the data value, and it doesn't make any sense to do
so because it isn't logical and probably not used by anyone, though we
might be able to support it as a specialized case.

We could accept:

        select interval year to month '1' month
        select interval year to month '1 month'

and as a special case:

        select interval '1 month' year to month

but not:

        select interval '1' year to month
        select interval year to month '1'

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

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Reply via email to