pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephan Szabo <sszabo@megazone.bigpanda.com>
To: Hannu Krosing <hannu@skype.net>
Cc: Bruce Momjian <pgman@candle.pha.pa.us>
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 12:32:42 -0800 (PST)
Message-ID: <20060301123127.D11836@megazone.bigpanda.com> (raw)
In-Reply-To: <1141244920.3737.10.camel@localhost.localdomain>
References: <200603012018.k21KIhi22006@candle.pha.pa.us>
	<1141244920.3737.10.camel@localhost.localdomain>

On Wed, 1 Mar 2006, Hannu Krosing wrote:

> Ühel kenal päeval, K, 2006-03-01 kell 15:18, kirjutas Bruce Momjian:
> > 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'.
>
> But unfortunately '2 mons -1 days' <> '1 mons 29 days'
>
> If I want something to happen 1 day less than two months from dome date,
> then the only way to say that consistently *is* '2 mons -1 days'.

Right, but would you call justify_days on such an interval?  '2 months -1
days' <> '1 mon 29 days', but '1 mon 60 days' is also <> '3 mons' in
general usage.



view thread (62+ messages)  latest in thread

Message-ID: <20060301123127.D11836@megazone.bigpanda.com>
Permalink:  ../20060301123127.D11836@megazone.bigpanda.com/
Also on:    postgresql.org/message-id/20060301123127.D11836@megazone.bigpanda.com

 · 

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

* 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