From: Bruno Wolff III <bruno@wolff.to>
To: Martin Marques <martin@bugs.unl.edu.ar>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Robert Creager <Robert_Creager@LogicalChaos.org>
Cc: pgsql-sql@postgresql.org
Subject: Re: inverse of "day of year"
Date: Mon, 22 Mar 2004 09:18:10 -0600
Message-ID: <20040322151810.GB2962@wolff.to> (raw)
In-Reply-To: <200403221014.40555.martin@bugs.unl.edu.ar>
References: <200403190906.17641.martin@bugs.unl.edu.ar>
<200403220832.32968.martin@bugs.unl.edu.ar>
<20040322125054.GA1135@wolff.to>
<200403221014.40555.martin@bugs.unl.edu.ar>
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.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: bruno@wolff.to, martin@bugs.unl.edu.ar, tgl@sss.pgh.pa.us, Robert_Creager@LogicalChaos.org
Subject: Re: inverse of "day of year"
In-Reply-To: <20040322151810.GB2962@wolff.to>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox