raf <raf@raf.org> writes:
> Q1) if an integer cannot be explicitly cast into an interval, what is happening
> when a date difference is stored in an interval variable to allow it to happen?
plpgsql is really lax about type coercions. It typically does them by
converting the source value to text and then converting that string to
the target type. If we were designing that language today, I doubt
we'd have accepted such a definition, but changing it now would break
a lot of code ...
regards, tom lane