I was helping with this question trying to change the format for the interval.
from \'01 day 22:10:37\' to \'46:10:37\'
From https://www.postgresql.org/docs/9.5/static/functions-formatting.html
to_char(interval)
formatsHH
andHH12
as shown on a 12-hour clock, i.e. zero hours and 36 hours output as 12, whileHH24
outputs the full hour value, which can exceed 23 for intervals.
From https://www.postgresql.org/docs/8.2/static/functions-formatting.html
to_char(interval)
formatsHH
andHH12
as hours in a single day, whileHH24
can output hours exceeding a single day, e.g. >24.
I'd guess that the first one use implicit format based on the result of the subtraction, and the second use an explicit format based on the input.