X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 37E63D1D5A3 for ; Mon, 22 Mar 2004 15:15:04 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 43801-06 for ; Mon, 22 Mar 2004 11:15:12 -0400 (AST) Received: from wolff.to (wolff.to [66.93.249.74]) by svr1.postgresql.org (Postfix) with SMTP id 3F859D1D58C for ; Mon, 22 Mar 2004 11:15:02 -0400 (AST) Received: (qmail 3066 invoked by uid 500); 22 Mar 2004 15:18:10 -0000 Date: Mon, 22 Mar 2004 09:18:10 -0600 From: Bruno Wolff III To: Martin Marques Cc: Tom Lane , Robert Creager , pgsql-sql@postgresql.org Subject: Re: inverse of "day of year" Message-ID: <20040322151810.GB2962@wolff.to> Mail-Followup-To: Martin Marques , Tom Lane , Robert Creager , pgsql-sql@postgresql.org 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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200403221014.40555.martin@bugs.unl.edu.ar> User-Agent: Mutt/1.5.6i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200403/220 X-Sequence-Number: 17319 On Mon, Mar 22, 2004 at 10:14:40 -0300, Martin Marques 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.