Improving the queries in a view to query custom types
Four comments:


You should mention that you are only querying for composite types.
You don't need to join with pg_namespace, you can just cast the schema's oid to regnamespace.
You could turn the subselect into a join for potentially better performance and readability.
The NOT EXISTS clause shouldn't be in the subselect, but in the main query.