Re: Oddity with literal intervals

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Oddity with literal intervals
Дата
Msg-id 10987.1079635129@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Oddity with literal intervals  (Mike Mascari <mascarm@mascari.com>)
Ответы Re: Oddity with literal intervals  (Mike Mascari <mascarm@mascari.com>)
Список pgsql-general
Mike Mascari <mascarm@mascari.com> writes:
> Here's something odd I stumbled upon:

> [estore@lexus] select now() - '1 day';
> ERROR:  invalid input syntax for type timestamp with time zone: "1 day"

What's odd about it?  The preferred interpretation is timestamptz minus
another timestamptz (yielding an interval).  If you want timestamptz
minus interval (yielding timestamptz), you have to do something to cue
the system that the literal should be taken as an interval.

The "+" cases work because there is no timestamp plus timestamp operator.

            regards, tom lane

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

Предыдущее
От: Ericson Smith
Дата:
Сообщение: Re: Opteron build process question
Следующее
От: Mike Mascari
Дата:
Сообщение: Re: Oddity with literal intervals