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

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: BUG #1517: SQL interval syntax is accepted by the parser,
Дата
Msg-id 200503201439.j2KEdFE16841@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: BUG #1517: SQL interval syntax is accepted by the parser,  (Roy Badami <roy@gnomon.org.uk>)
Ответы Re: BUG #1517: SQL interval syntax is accepted by the parser,  (Roy Badami <roy@gnomon.org.uk>)
Re: BUG #1517: SQL interval syntax is accepted by the parser,  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
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

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Roy Badami
Дата:
Сообщение: Re: BUG #1517: SQL interval syntax is accepted by the parser,
Следующее
От: Roy Badami
Дата:
Сообщение: Re: BUG #1517: SQL interval syntax is accepted by the parser,