Re: [HACKERS] Interval subtracting

From: PFC <lists(at)peufeu(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: [HACKERS] Interval subtracting
Date: 2006-03-08 21:23:05
Message-ID: op.s535oruacigqcu@apollo13
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches pgsql-sql


> For same reasons, i.e. a need for precision, I find it hard to accept
> the idea of mixing positive and negative units in the same interval.
> The plus or minus sign should be outside of the interval.

The interval data type is really useful. I see no reason to restrict its
usefulness with an arbitrary constraint. Date arithmetic is treacherous
and INTERVAL is a lifesaver.

Forcing a global sign on the interval would break interval arithmetic.
How would you compute '1 month'::interval - '1 week'::interval ?

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2006-03-08 21:45:14 Re: Problemas with gram.y
Previous Message Dann Corbit 2006-03-08 20:39:55 Re: Merge algorithms for large numbers of "tapes"

Browse pgsql-patches by date

  From Date Subject
Next Message Neil Conway 2006-03-08 21:57:52 Re: [PATCHES] Add switches for DELIMITER and NULL in pg_dump COPY
Previous Message Jonah H. Harris 2006-03-08 20:11:57 Re: CREATE SYNONYM ...

Browse pgsql-sql by date

  From Date Subject
Next Message Josh Berkus 2006-03-08 21:58:25 Is there any way to stop triggers from cycling?
Previous Message Tom Lane 2006-03-08 16:24:12 Re: Errors ignored on restore