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

From: Doug McNaught <doug(at)mcnaught(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Ricardo Perez Lopez" <ricpelo(at)hotmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: '1 year' = '360 days' ????
Date: 2004-10-24 00:13:51
Message-ID: 87ekjpnfb4.fsf@asmodeus.mcnaught.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:

> "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?

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2004-10-24 01:04:59 Re: Duplicating a database
Previous Message Karim Nassar 2004-10-24 00:08:04 Re: Duplicating a database