Search Postgresql Archives

to_char(interval, text) deprecated in future - how do we get consistent interval output without it?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I saw the note in the docs that to_char(interval, text) is deprecated, and
will be removed.  I searched the archives and saw more mentions of this,
but no real explanation as to how it is planned for us to get consistent
output formatting when querying a column containing interval data.

For example, if you have data in an "interval" column, and just SELECT it
(without special formatting), you get things like:
 00:05:00
3 days
1 day 04:00:00
3 days 03:10:00

Currently, if I use something like:  to_char(t.estimated_time, 'DD
HH24:MI'),  I seem to get consistent results that my program can easily
deal with:

00 00:05
00 00:10
01 04:00
00 01:05
03 03:10

Can someone please explain if there is something else I should be using, or
what the plans actually are for handling this in future?  Should I just
store the value in seconds as an integer and handle everything myself?

Thanks,
Susan Cassidy




----------------------------------------------------------------------------------------------
See our award-winning line of tape and disk-based
backup & recovery solutions at http://www.overlandstorage.com
----------------------------------------------------------------------------------------------


---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux