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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #1517: SQL interval syntax is accepted by the parser,
Дата
Msg-id 804.1111689778@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: BUG #1517: SQL interval syntax is accepted by the parser,  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-bugs
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Agreed.  What is really weird is that the time is always displayed for a
> zero value:

>     test=> select interval '0 years' year;
>      interval
>     ----------
>      00:00:00
>     (1 row)

> but a non-zero shows the proper units:

>     test=> select interval '1 years' year;
>      interval
>     ----------
>      1 year
>     (1 row)

> Is that OK?

Well, it's a bit arbitrary, but I suppose it was done because otherwise
a zero interval would show nothing at all ...

            regards, tom lane

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

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