Re: Bug 1500 - Mailing list pgsql-hackers

From lsunley@mb.sympatico.ca
Subject Re: Bug 1500
Date
Msg-id 0IDZ00G68E6XA4@l-daemon
Whole thread Raw
In response to Re: Bug 1500  (Josh Berkus <josh@agliodbs.com>)
List pgsql-hackers
This has my vote....

Lorne

In <200503261404.14979.josh@agliodbs.com>, on 03/26/05   at 02:04 PM, Josh Berkus <josh@agliodbs.com> said:

>Karel,

>> > Yeah.  áKarel Zak, who wrote that code, is convinced we should remove it,
>> > but I don't think anyone else is ...
>>
>>  áI think I was Peter and Josh Berkus who convinced me that the code is
>> bed. "we should remove..." is opinion only...

>I certainly didn't recommend removing it before we have a replacement
>ready.  

>The complaint, btw, was that the current to_char formats intervals as if
>they  were dates.   This results in some rather confusing output.   I
>wanted to  improve to_char to support proper interval formatting, but
>apparently it's  difficult to do that without breaking other aspects of
>to_char (at least, I  was told that).   

>What we need is a function or functions which do the following:

>SELECT to_char( INTERVAL '43 hours 20 minutes', 'MI' ) || ' min'; 2600
>min

>SELECT to_char( INTERVAL '43 hours 20 minutes', 'WK:DD:HR:MI' );
>0:1:19:20

>SELECT to_char( INTERVAL '3 years 5 months','MM' ) || ' mons'; 41 mons

>etc.  This would be more sophisticated than the logic employed for the
>current  to_char, as the interval would be re-calculated in the units
>supplied,  limited by the month/year|day/hour/minute boundary.   



-- 
-----------------------------------------------------------
lsunley@mb.sympatico.ca
-----------------------------------------------------------



pgsql-hackers by date:

Previous
From: Josh Berkus
Date:
Subject: Re: Bug 1500
Next
From: Alvaro Herrera
Date:
Subject: Re: Bug 1500