pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #8361: 9.3~beta2-2: Wrong `interval' format with aggregate functions.
2+ messages / 2 participants
[nested] [flat]

* BUG #8361: 9.3~beta2-2: Wrong `interval' format with aggregate functions.
@ 2013-08-04 02:00 jbglaw@lug-owl.de
  2013-08-04 04:08 ` Re: BUG #8361: 9.3~beta2-2: Wrong `interval' format with aggregate functions. Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 2+ messages in thread

From: jbglaw@lug-owl.de @ 2013-08-04 02:00 UTC (permalink / raw)
  To: pgsql-bugs

The following bug has been logged on the website:

Bug reference:      8361
Logged by:          Jan-Benedict Glaw
Email address:      jbglaw@lug-owl.de
PostgreSQL version: Unsupported/Unknown
Operating system:   Debian unstable/experimental
Description:        

Hi!


I just found intervals that are shown with more than 24 hours in the `hours'
field. Their overall shown value matches EXTRACT (expoch from xxxx), but the
printed value looks bogus:


buildmaster=> select avg(lastbuild_same) from test_values ;
          avg
-----------------------
 1 day 26:16:18.678927
(1 row)




Notice the "26" there. It's actually 2 days 2h 16min 18sec.


Short SQL snippet can be found at
http://lug-owl.de/~jbglaw/intervals_not_printed_correctly.sql


Would be nice if somebody would test this with further PostgreSQL versions
and specifically with the most recent development branch.


Thanks,
Jan-Benedict



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



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: BUG #8361: 9.3~beta2-2: Wrong `interval' format with aggregate functions.
  2013-08-04 02:00 BUG #8361: 9.3~beta2-2: Wrong `interval' format with aggregate functions. jbglaw@lug-owl.de
@ 2013-08-04 04:08 ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2013-08-04 04:08 UTC (permalink / raw)
  To: jbglaw@lug-owl.de; +Cc: pgsql-bugs

jbglaw@lug-owl.de writes:
> I just found intervals that are shown with more than 24 hours in the `hours'
> field.

This is not erroneous.  "24 hours" is not necessarily equivalent to "1
day", so the interval type doesn't automatically transpose one to the
other.  If you want that sort of conversion, see the justify_days(),
justify_hours(), and justify_interval() functions.

			regards, tom lane


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



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2013-08-04 04:08 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2013-08-04 02:00 BUG #8361: 9.3~beta2-2: Wrong `interval' format with aggregate functions. jbglaw@lug-owl.de
2013-08-04 04:08 ` Tom Lane <tgl@sss.pgh.pa.us>

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