Tom Lane wrote:
> So the hard part of this doesn't really require any understanding of
> code at all. What we need is a proposal for an algorithm that loosens
> the casting rules "just enough" to make explicit pg_cast entries for
> domains work the way we would like them to, without wholesale breakage
> of situations that have nothing to do with domains. See
> http://developer.postgresql.org/pgdocs/postgres/typeconv.html
>
> Rereading what I just wrote, it might be as simple as allowing a
> two-step cast in certain cases, only if the first step is a domain to
> base type coercion (which we assume would be specially marked in
> pg_cast).
FWIW, before I got to this paragraph that was the thought that
immediately occurred to me.
cheers
andrew