Using postgresql 9.1 with linux psql console and the windows pgadminIII the query:
select '2012-05-05 15:57:31-07'::timestamp with time zone - '2012-05-01 23:13:34-07'::timestamp with time zone;
renders the return as:
?column?
-----------------
3 days 16:43:57
(1 row)
However, the windows JDBC driver (specifically using jasperreport’s ireport) renders this same query as:
?column?
-----------------
0 years 0 mons 3 days 16 hours 43 mins 57.00 secs
(1 row)
I’ve explored to_char and the postgresql documentation but cannot find a solution. Two questions: First, how can I make the JDBC driver render the interval with the same formatting as pqsl?
Second, can I instead make both psql and JDBC render the result as:
88:43:57
where hours keep counting into the 100s as the interval grows (its a silly industry standard…)
I made myself a function that does what I need. I’m all ears for suggestions, improvements, and optimizations.