 select row_to_json(x) as object from type as x
 union all
 select row_to_json(x) as object from "constraint" as x
+-- union all
+-- select row_to_json(x) as object from procedure as x
 ;

    order by
      att.attrelid, att.attnum
  ),
  -- @see https://www.postgresql.org/docs/9.5/static/catalog-pg-type.html
  type as (
    -- Use another `WITH` statement here, because our `WHERE` clause will need

    where
      typ.id in (select "typeId" from class) or
      typ.id in (select "typeId" from attribute) or
      -- typ.id in (select "returnTypeId" from procedure) or
      -- typ.id in (select unnest("argTypeIds") from procedure) or
      -- If this type is a base type for *any* domain type, we will include it
      -- in our selection. This may mean we fetch more types than we need, but
      -- the alternative is to do some funky SQL recursion which would be hard
