Re: Absolute value of intervals

From: Ron Mayer <rm_pg(at)cheapcomplexdevices(dot)com>
To: Sam Mason <sam(at)samason(dot)me(dot)uk>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Absolute value of intervals
Date: 2009-11-02 14:06:39
Message-ID: 4AEEE76F.2090807@cheapcomplexdevices.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Nov 02, 2009 at 10:52:40AM +0000, Jasen Betts wrote:
> what's the absolute value of '1month -30 days'::interval

Curious what a use case for taking the absolute value
of such mixed intervals might be.

I could imagine such intervals being used for stuff like
"XXX is due in Y months but needs to be submitted Z days earlier".

But I can't really imagine worrying about if it's positive
or negative until it's evaluated at a particular date (i.e.
reporting "XXX has to be submitted in N days" or
"XXX was supposed to be submitted N days ago").

In response to

Browse pgsql-general by date

  From Date Subject
Next Message John DeSoi 2009-11-02 14:12:17 Re: Cancelling Requests Frontend/Backend Protocol TCP/IP
Previous Message Raymond O'Donnell 2009-11-02 13:59:43 Re: 2009-11-02 08:31:30 EST:user@host(48990):4562ERROR: current transaction is aborted, commands ignored until end of transaction block