Re: operator suggest " interval / interval = numeric"

Поиск
Список
Период
Сортировка
От Warren Turkal
Тема Re: operator suggest " interval / interval = numeric"
Дата
Msg-id 7fdf8c4d0801092138i75f781dfiafceacbc59aa4cd1@mail.gmail.com
обсуждение исходный текст
Ответ на Re: operator suggest " interval / interval = numeric"  ("Brendan Jurd" <direvus@gmail.com>)
Ответы Re: operator suggest " interval / interval = numeric"  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Jan 9, 2008 9:29 PM, Brendan Jurd <direvus@gmail.com> wrote:
> Sorry, a correction.  The issue of years vs. days isn't ignored.  A
> year is just 12 months, which yields 12 * 30 = 360 days, which is
> actually a pretty significant error (1.4% on average).

YEAR TO MONTH and DAY TO {HOUR,MINUTE,SECOND} intervals should not
combine. PostgreSQL correctly doesn't allow {YEAR,MONTH} TO
{DAY,HOUR,MINUTE,SECOND} intervals, and it shouldn't allow operating
on invalid intervals combinations either. One mistake that PG does
make is that it allows a "FULL RANGE" interval. This weirdness is
essentially a YEAR TO SECOND interval that isn't allowed when
explicitly requested.

wt-time=> select INTERVAL '1 year 1 month 1 day 1:1:1';         interval
-----------------------------1 year 1 mon 1 day 01:01:01
(1 row)

wt-time=> select INTERVAL '1 year 1 month 1 day 1:1:1' YEAR TO SECOND;
ERROR:  syntax error at or near "SECOND"
LINE 1: select INTERVAL '1 year 1 month 1 day 1:1:1' YEAR TO SECOND;
       ^
 
This is inconsistent. I would like to ultimately not allow operations
on interval combinations that are not allowed by the SQL standard.

wt


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

Предыдущее
От: "Brendan Jurd"
Дата:
Сообщение: Re: operator suggest " interval / interval = numeric"
Следующее
От: Tom Lane
Дата:
Сообщение: Re: flex/bison output wrongly created in the source directory