Re: ERROR: operator does not exist: timestamp without time zone + integer

Поиск
Список
Период
Сортировка
От Andrew Gierth
Тема Re: ERROR: operator does not exist: timestamp without time zone + integer
Дата
Msg-id 878svrux71.fsf@news-spur.riddles.org.uk
обсуждение исходный текст
Ответ на Re: ERROR: operator does not exist: timestamp without time zone +integer  (Adrian Klaver <adrian.klaver@aklaver.com>)
Ответы Re: ERROR: operator does not exist: timestamp without time zone +integer  (Adrian Klaver <adrian.klaver@aklaver.com>)
Список pgsql-general
>>>>> "Adrian" == Adrian Klaver <adrian.klaver@aklaver.com> writes:

 >> yeesh. that's a very long-winded way to write current_date + 7

 Adrian> Yeah, I was just working of the OP's original DEFAULT:

 Adrian> site_mode_date timestamp NOT NULL DEFAULT date_trunc('day',
 Adrian> LOCALTIMESTAMP)+7,

Right, but since all these are exactly equivalent:

CURRENT_DATE
LOCALTIMESTAMP::date
date_trunc('day',LOCALTIMESTAMP)::date

and since date can be cast to timestamp, then DEFAULT current_date+7
would seem to be the simplest answer.

-- 
Andrew (irc:RhodiumToad)



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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: ERROR: operator does not exist: timestamp without time zone +integer
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: ERROR: operator does not exist: timestamp without time zone +integer