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 200503230549.j2N5nfH06124@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: BUG #1517: SQL interval syntax is accepted by the parser,  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: BUG #1517: SQL interval syntax is accepted by the parser,  (Roy Badami <roy@gnomon.org.uk>)
Список pgsql-bugs
Added to TODO also:

    * Interpret INTERVAL '1:30' MINUTE TO SECOND as '1 minute 30 seconds'


---------------------------------------------------------------------------

Tom Lane wrote:
> Roy Badami <roy@gnomon.org.uk> writes:
> > Similary the undocumented postgresism of interpreting
> >      INTERVAL '1:02'
> > as 1 hour 2 minutes is consistent with the ANSI
> >          INTERVAL '1:02' HOUR TO MINUTE
> > but not with the ANSI
> >      INTERVAL '1:02' MINUTE TO SECOND
> > which of course means 1 minute 2 seconds.
>
> Well, that's an annoying case but I don't think it means we should throw
> up our hands and reject cases that are (a) perfectly unambiguous and
> (b) accepted by the present and past code.
>
> We have to be able to support casts from undecorated INTERVAL to
> INTERVALs with typmods, so most of these issues *have* to be dealt with
> anyway; we can't arbitrarily reject them.  What I am thinking is that
> (a) if the input string is undecorated or ambiguous, use the typmod
> to help resolve it --- in particular this should cover all of the
> spec-mandated cases.
> (b) if it is unambiguous Postgres-style syntax, read it that way and
> then perform a cast to the restricted interval type.
>
>             regards, tom lane
>

--
  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 по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: BUG #1518: Conversions to (undocumented) SQL year-month and
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: BUG #1552: massive performance hit between 7.4 and 8.0.1