Re: date + interval year - why is the return type convered to a timestamp?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: date + interval year - why is the return type convered to a timestamp?
Дата
Msg-id 16906.1256253357@sss.pgh.pa.us
обсуждение исходный текст
Ответ на date + interval year - why is the return type convered to a timestamp?  (the6campbells <the6campbells@gmail.com>)
Список pgsql-sql
the6campbells <the6campbells@gmail.com> writes:
> Why is Postgres returning a timestamp instead of the expected date data type
> for the first expression (the second returns a date)?

> select date '2001-03-30' - interval '1' year, date '2001-03-30' - integer
> '365' from tversion

Would you expect a date fordate '2001-03-30' - interval '1 hour'
?  They are type-wise the same case; we don't have different types for
different lengths of interval.
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: question about timestamp with tz
Следующее
От: Scott Marlowe
Дата:
Сообщение: Re: question about timestamp with tz