SELECT pg_catalog.format_type(castsource, NULL) AS "Source",
       pg_catalog.format_type(casttarget, NULL) AS "Target",
       CASE WHEN castfunc = 0 THEN pg_catalog.pg_gettext('BINARY')
            ELSE p.proname
       END as "Function",
       CASE WHEN c.castcontext = 'e' THEN pg_catalog.pg_gettext('no')
            WHEN c.castcontext = 'a' THEN pg_catalog.pg_gettext('in assignment')
            ELSE pg_catalog.pg_gettext('yes')
       END as "Implicit?"
FROM pg_catalog.pg_cast c LEFT JOIN pg_catalog.pg_proc p
     ON c.castfunc = p.oid,
     (SELECT $1 AS cmd) AS cmd
ORDER BY 1, 2