Martijn van Oosterhout <kleptog(at)svana(dot)org> writes:
> What I'm trying to do now is use fcinfo->flinfo->fn_oid to lookup
> pg_proc and get the return type from there, but something tells me
> there must be an easier way.
No, I think you're stuck. The internal calls for type I/O routines
don't set up fn_expr (since there is no expression tree).
One possibility, depending on your time horizon for this, is to change
the getTypeIOParam rules so that ordinary types get their own OID as
second argument.
regards, tom lane