Re: '1 year' = '360 days' ????

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Ricardo Perez Lopez" <ricpelo(at)hotmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: '1 year' = '360 days' ????
Date: 2004-10-23 23:52:50
Message-ID: 28505.1098575570@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Ricardo Perez Lopez" <ricpelo(at)hotmail(dot)com> writes:
> I have observed that, for PostgreSQL, one year is actually 360 days:

> SELECT '1 year'::timestamp = '360 days'::timestamp;

> ?column?
> -------------
> t

Nonsense.

regression=# SELECT '1 year'::timestamp = '360 days'::timestamp;
ERROR: invalid input syntax for type timestamp: "1 year"

How about telling us what you *really* did, instead of posting faked
examples?

There are some contexts in which an interval (not a timestamp) of 1
month will be taken as equivalent to 30 days, for lack of any better
idea, but it's not the case that Postgres doesn't know the difference.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2004-10-23 23:55:37 Re: COPY data and referential triggers ...
Previous Message Bruno Wolff III 2004-10-23 23:49:15 Comment on timezone and interval types