pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David G Johnston <david.g.johnston@gmail.com>
To: pgsql-bugs@postgresql.org
Subject: Re: BUG #11031: Unexpected interval representations
Date: Thu, 24 Jul 2014 07:49:37 -0700 (PDT)
Message-ID: <1406213377403-5812727.post@n5.nabble.com> (raw)
In-Reply-To: <20140724132303.32098.66956@wrigleys.postgresql.org>
References: <20140724132303.32098.66956@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

marius.bauer wrote
> The following bug has been logged on the website:
> 
> Bug reference:      11031
> Logged by:          Marius Bauer
> Email address:      

> marius.bauer@

> PostgreSQL version: 9.3.3
> Operating system:   Amazon RDS
> Description:        
> 
> Please see following query and result:
> 
> unitystg=> select a + b as sum, b - a as dif, 2 * a as pro, b / 2 as quo
> from (select interval'1 day 15:45:25' as a, interval'2 days 12:34:56' as
> b)
> as foo;
>        sum       |       dif       |       pro       |      quo
> -----------------+-----------------+-----------------+----------------
>  3 days 28:20:21 | 1 day -03:10:29 | 2 days 31:30:50 | 1 day 06:17:28
> (1 row)
> 
> Usually I'd expect the day will be adjusted in those cases when the hour
> is
>>= 24 or < 0, but this does not happen.
> 
> The interval value itself is correct, just the representation is
> unexpected.

Unexpected != Bug; this question belongs on -general

See http://www.postgresql.org/docs/9.3/interactive/functions-datetime.html

Justify_days
Justify_hours

David J.





--
View this message in context: http://postgresql.1045698.n5.nabble.com/BUG-11031-Unexpected-interval-representations-tp5812713p5812...
Sent from the PostgreSQL - bugs mailing list archive at Nabble.com.


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (4+ messages)  latest in thread

Message-ID: <1406213377403-5812727.post@n5.nabble.com>
Permalink:  ../1406213377403-5812727.post@n5.nabble.com/
Also on:    postgresql.org/message-id/1406213377403-5812727.post@n5.nabble.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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: david.g.johnston@gmail.com
  Subject: Re: BUG #11031: Unexpected interval representations
  In-Reply-To: <1406213377403-5812727.post@n5.nabble.com>
  References: <20140724132303.32098.66956@wrigleys.postgresql.org> <1406213377403-5812727.post@n5.nabble.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