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

From: SCassidy(at)overlandstorage(dot)com
To: pgsql-general(at)postgresql(dot)org
Subject: to_char(interval, text) deprecated in future - how do we get consistent interval output without it?
Date: 2005-01-14 19:36:26
Message-ID: OF9FBEF9BF.A5933372-ON88256F89.006A95AF-88256F89.006BB4F8@myoverland.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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
----------------------------------------------------------------------------------------------

Responses

Browse pgsql-general by date

  From Date Subject
Next Message PFC 2005-01-14 19:49:24 MOVE
Previous Message Michael Fuhr 2005-01-14 19:20:50 Re: OID Usage