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

Поиск
Список
Период
Сортировка
От Roy Badami
Тема Re: BUG #1517: SQL interval syntax is accepted by the parser,
Дата
Msg-id 16961.54371.882191.556057@giles.gnomon.org.uk
обсуждение исходный текст
Ответ на Re: BUG #1517: SQL interval syntax is accepted by the parser,  (Bruce Momjian <pgman@candle.pha.pa.us>)
Ответы Re: BUG #1517: SQL interval syntax is accepted by the parser,  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-bugs
Bruce> The reason I added it is that usually people think of the
    Bruce> PG syntax as '1 hour 30 seconds'.  The '1:30' is a kind of
    Bruce> subtle because both PG and ANSI support that syntax and we
    Bruce> need to handle that.  The tricky part is that we can't say
    Bruce> by looking at '1:30' whether it is PG or ANSI, and that
    Bruce> will affect how we deal with the clause after it.

It could be either in ANSI:

   INTERVAL '1:30' MINUTE TO SECOND
   INTERVAL '1:30' HOUR TO MINUTE

Similarly, pg interprets

   INTERVAL '1'

as

   INTERVAL '1 second'

In ANSI, it could be any one of

   INTERVAL '1' SECOND
   INTERVAL '1' MINUTE
   INTERVAL '1' HOUR
   INTERVAL '1' DAY
   INTERVAL '1' MONTH
   INTERVAL '1' YEAR

In ANSI you can only parse the string by reference to the interval type.

   -roy

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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: BUG #1517: SQL interval syntax is accepted by the parser,
Следующее
От: Keith Browne
Дата:
Сообщение: Re: BUG #1552: massive performance hit between 7.4 and 8.0.1