Re: Inconsistent time interval formatting - Mailing list pgsql-general

From Allen Chen
Subject Re: Inconsistent time interval formatting
Date
Msg-id AANLkTik+cLNKp8Kdsh52_kEY9F755L0QmZaXU0ttQ+4T@mail.gmail.com
Whole thread Raw
In response to Re: Inconsistent time interval formatting  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Inconsistent time interval formatting
Re: Inconsistent time interval formatting
List pgsql-general


That won't really help.  The fundamental point here is that '1 day' is
not the same concept as '24 hours', because of DST changes; and the
interval type treats them as different.

If you don't care about that, you can use justify_hours (I think that's
the right function) to smash them to the same thing.

But I suspect the OP's real complaint would be better solved by use of
to_char() to produce an output format that includes zeroes instead of
dropping fields that are zero.

                       regards, tom lane

Hi Tom,

I don't understand how DST changes matter for a time interval or how that could even be factored into calculations.  Could you elaborate on that?  I had a query today that returned an interval of 70:23:06.935933.  Wouldn't that be at least two days regardless of DST?

Thanks for shining the light on justify_hours, though.  I did not know that function existed.  That does give me a way to have consistent output for reporting.

Thanks to everyone who replied!

-Allen

pgsql-general by date:

Previous
From: Nicklas Avén
Date:
Subject: Re: Performance on multiple OR conditions inside ()
Next
From: Jensen Somers
Date:
Subject: Install PostgreSQL as part of a desktop application, but how to coop with existing installations?