On Mon, Nov 02, 2009 at 10:52:40AM +0000, Jasen Betts wrote: > what's the absolute value of '1month -30 days'::interval > > if I add it to the first of march it goes forwards if I add it to the > first of february if goes backwards. if I add it to the first of april > it goes nowhere. > > select '2008-02-01'::date + '1month -30days'::interval; > select '2008-03-01'::date + '1month -30days'::interval; > select '2008-04-01'::date + '1month -30days'::interval; > > I'm guessing that '1 month 30 days' is the only mathematically > consistent answer, not that it's likely to be useful. Except that this is not consistent with itself. Most definitions have the absolute value of a number being the same as either the number itself or its negation. -- Sam http://samason.me.uk/ -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general