Sebastien Flaesch <sebastien.flaesch@xxxxxxx> writes: > When doing a SUM( ) aggregate on an INTERVAL HOUR TO SECOND(0) column, the resulting type loses the interval type qualifiers... We don't generally attribute a typmod (which is what interval field specs are) to the output of any function, other than the ones that are specifically identified in the catalogs as cast-to-a-particular-typmod infrastructure. Why do you care? The value is the same regardless. > The type of a SELECT item is important to us because we have generic C code that identifies the PQfmod() type, to properly interpret the string value returned by PQgetvalue(). I think you have vastly overestimated the value of PQfmod. Moreover, if you think you need it to interpret the output data, you are mistaken. There is no situation in which Postgres output formats are typmod-specific; in fact, the output function API doesn't even pass the typmod. regards, tom lane