pg_upgrade is a little over-keen about checking for shared libraries
that back functions. In particular, it checks for libraries that support
functions created in pg_catalog, even if pg_dump doesn't export the
function.
The attached patch mimics the filter that pg_dump uses for functions so
that only the relevant libraries are checked.
This would remove the need for a particularly ugly hack in making the
9.1 backport of JSON binary upgradeable.
cheers
andrew