> > Given the lack of to_char(interval), I'd like to write a PLPGSQL
> > function to fill the gap in the meantime...
> I mean is too much difficult write a 'interval' to_char() version in
> some procedural language without access to real (internal) form of
> 'interval'.
I agree with Karel's point that it may be a pain to use a procedural
language to manipulate a "stringy" interval value. If you use a C
function instead, you can get access to the internal manipulation
functions already present, as well as access to system functions to
manipulate a tm structure.
A combination of contrib/ and src/backend/utils/adt/ information could
give you a start on the C implementation (and that is rather easily
moved into the backend later).
I haven't tried the PL/PGSQL approach however. If you decide to proceed
on that, let us know how it goes!
- Thomas