Re: '1 year' = '360 days' ???? - Mailing list pgsql-general

From Doug McNaught
Subject Re: '1 year' = '360 days' ????
Date
Msg-id 87ekjpnfb4.fsf@asmodeus.mcnaught.org
Whole thread Raw
In response to Re: '1 year' = '360 days' ????  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: '1 year' = '360 days' ????  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Tom Lane <tgl@sss.pgh.pa.us> writes:

> "Ricardo Perez Lopez" <ricpelo@hotmail.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?

FWIW:

template1=# select '1 year'::interval = '360 days'::interval;
 ?column?
----------
 t
(1 row)

template1=# select '1 year'::interval = '365 days'::interval;
 ?column?
----------
 f
(1 row)

template1=# select version();
                               version
---------------------------------------------------------------------
 PostgreSQL 7.4.5 on i686-pc-linux-gnu, compiled by GCC egcs-2.91.66
(1 row)

-Doug

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: COPY data and referential triggers ...
Next
From: "Scott Marlowe"
Date:
Subject: Re: Duplicating a database