Re: inverse of "day of year" - Mailing list pgsql-sql

From Bruno Wolff III
Subject Re: inverse of "day of year"
Date
Msg-id 20040322151810.GB2962@wolff.to
Whole thread Raw
In response to Re: inverse of "day of year"  (Martin Marques <martin@bugs.unl.edu.ar>)
Responses Re: inverse of "day of year"  (Dana Hudes <dhudes@tcp-ip.info>)
List pgsql-sql
On Mon, Mar 22, 2004 at 10:14:40 -0300, Martin Marques <martin@bugs.unl.edu.ar> wrote:
> 
> Any thoughts on how this could affect date manipulation?

This is consistant with what I explained about the behavior when adding
a month results in a day in a month past the end of the new month.
What do you expect to have happen here?

> mydb=> select '29/2/2004'::date + ((2005 - date_part('year', now())::int) || 
> 'years')::interval;
>       ?column?
> ---------------------
>  2005-02-28 00:00:00
> 
> AFAIKS with other dates this works OK. :-)

The real issue with intervals is that how they work in unusual cases is
not documented. The behavior could change in a future version without
much fanfare.


pgsql-sql by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: special integrity constraints
Next
From: Dana Hudes
Date:
Subject: Re: inverse of "day of year"