Re: Bug #733: Date Arithmetics within plsql

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Bug #733: Date Arithmetics within plsql
Дата
Msg-id 28467.1028772417@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Bug #733: Date Arithmetics within plsql  (pgsql-bugs@postgresql.org)
Список pgsql-bugs
pgsql-bugs@postgresql.org writes:
> jw=# select inc_date (date  '2002-10-25', interval '1 day');
>   inc_date
> ------------
>  2002-10-26                  -> ok
> (1 row)

What you probably want here is the date plus integer operator.

There is no date plus interval operator --- what you are actually
getting is implicit promotion of date to timestamp, then timestamp
plus interval, then coercion back to date.  Unfortunately that's
going to create roundoff problems when you cross daylight-savings
boundaries.

            regards, tom lane

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

Предыдущее
От: Jean-Luc Lachance
Дата:
Сообщение: Re: Bug #733: Date Arithmetics within plsql
Следующее
От: Tom Lane
Дата:
Сообщение: Re: followup question Bug #476: pg_dump error: dtoi4: integer out of range