Re: [HACKERS] date/time problem in v6.5.3 and 7.0.0 ...

Поиск
Список
Период
Сортировка
От Thomas Lockhart
Тема Re: [HACKERS] date/time problem in v6.5.3 and 7.0.0 ...
Дата
Msg-id 38847B5B.DA4BEE00@alumni.caltech.edu
обсуждение исходный текст
Ответ на date/time problem in v6.5.3 and 7.0.0 ...  (The Hermit Hacker <scrappy@hub.org>)
Ответы Re: [HACKERS] date/time problem in v6.5.3 and 7.0.0 ...  (Tatsuo Ishii <t-ishii@sra.co.jp>)
Список pgsql-hackers
> > I can add days to now(), but not subtract?

The problem is that it is meaningful to subtract two absolute times,
giving a delta time as a result, *and* it is meaningful to subtract a
delta time from an absolute time, giving another absolute time as a
result. 

So your unspecified field could be either one, and Postgres can't
decide what it should be for you ;)

The error message is intentionally vague, since by the time the
message is printed the parser has lost track of whether there were
zero candidates or too many candidates.
                     - Thomas

> > =====================================
> >
> > template1=> select now() + '30 days';
> >            ?column?
> > ------------------------------
> >  Sun Feb 13 22:00:33 2000 AST
> > (1 row)
> >
> > template1=> select now() - '30 days';
> > ERROR:  Unable to identify an operator '-' for types 'timestamp' and 'unknown'
> >         You will have to retype this query using an explicit cast

-- 
Thomas Lockhart                lockhart@alumni.caltech.edu
South Pasadena, California


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

Предыдущее
От: Jose Soares
Дата:
Сообщение: Re: [HACKERS] date/time problem in v6.5.3 and 7.0.0 ...
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] Cannot compile psql