extended result type handling with catalog/pg_type.h