now() and interval

Поиск
Список
Период
Сортировка
От Travis Hoyt
Тема now() and interval
Дата
Msg-id DBEMKMGOMJAGKAKEPPEGEELGDIAA.thoyt@npc.net
обсуждение исходный текст
Ответы Re: now() and interval
Список pgsql-novice
Just curious, why does this date manipulation return the incorrect value
based on the order of the operation?

output from now() for reference for below:

mydb=> select now();
             now
------------------------------
 2002-04-03 10:02:23.52309-05
(1 row)



mydb=> select interval '1 month' + now();
      ?column?
---------------------
 2002-04-03 00:00:00
(1 row)

mydb=> select now() + interval '1 month';
           ?column?
-------------------------------
 2002-05-03 10:02:44.038337-04
(1 row)

I can only assume it's because now() overwrites some values?  Is this
supposed to work this way?

Travis

Вложения

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