pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <pgman@candle.pha.pa.us>
To: Scott Marlowe <smarlowe@g2switchworks.com>
Cc: Stephan Szabo <sszabo@megazone.bigpanda.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Milen A. Radev <milen@radev.net>
Cc: pgsql-sql@postgresql.org
Cc: pgsql-hackers@postgresql.org
Subject: Re: [SQL] Interval subtracting
Date: Wed, 1 Mar 2006 15:27:46 -0500 (EST)
Message-ID: <200603012027.k21KRk423759@candle.pha.pa.us> (raw)
In-Reply-To: <1141244474.18820.12.camel@state.g2switchworks.com>

Scott Marlowe wrote:
> On Wed, 2006-03-01 at 14:18, Bruce Momjian wrote:
> > Stephan Szabo wrote:
> > > > justify_days doesn't currently do anything with this result --- it
> > > > thinks its charter is only to reduce day components that are >= 30 days.
> > > > However, I think a good case could be made that it should normalize
> > > > negative days too; that is, the invariant on its result should be
> > > > 0 <= days < 30, not merely days < 30.
> > > 
> > > What about cases like interval '1 month -99 days', should that turn into
> > > interval '-3 mons +21 days' or '-2 mons -9 days'?
> > 
> > I think it should be the later.  It is best to have a single sign, and I
> > think it is possible in all cases:
> > 
> > 	'2 mons -1 days'
> > 
> > could be adjusted to '1 mons 29 days'.
> 
> There's a part of me that thinks the WHOLE THING should be positive or
> negative:
> 
> -(2 months 1 day)

But it isn't '-2 months, -1 day'.  I think what you are saying is what I
am saying, that we should make the signs consistent.

-- 
  Bruce Momjian   http://candle.pha.pa.us
  SRA OSS, Inc.   http://www.sraoss.com

  + If your life is a hard drive, Christ can be your backup. +



view thread (62+ messages)  latest in thread

Message-ID: <200603012027.k21KRk423759@candle.pha.pa.us>
Permalink:  ../200603012027.k21KRk423759@candle.pha.pa.us/
Also on:    postgresql.org/message-id/200603012027.k21KRk423759@candle.pha.pa.us

 · 

reply

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: pgman@candle.pha.pa.us, smarlowe@g2switchworks.com, sszabo@megazone.bigpanda.com, tgl@sss.pgh.pa.us, milen@radev.net, pgsql-hackers@postgresql.org
  Subject: Re: [SQL] Interval subtracting
  In-Reply-To: <200603012027.k21KRk423759@candle.pha.pa.us>

* 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