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

From: Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu>
To: The Hermit Hacker <scrappy(at)hub(dot)org>
Cc: Jose Soares <jose(at)sferacarta(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [HACKERS] date/time problem in v6.5.3 and 7.0.0 ...
Date: 2000-01-18 14:40:27
Message-ID: 38847B5B.DA4BEE00@alumni.caltech.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)alumni(dot)caltech(dot)edu
South Pasadena, California

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Meskes 2000-01-18 15:27:03 patches list
Previous Message Jose Soares 2000-01-18 14:10:58 Re: [HACKERS] date/time problem in v6.5.3 and 7.0.0 ...