Total objects per tablespace

Owner Tablespace Object's type Count
guillaume pg_global Index 15
guillaume pg_global Tables 7

SELECT rolname, spcname, CASE WHEN relkind='r' THEN 'Tables' ELSE 'Index' END AS kind, count(*) AS total FROM pg_class, pg_tablespace, pg_roles WHERE spcowner=pg_roles.oid AND pg_tablespace.oid=reltablespace AND relkind IN ('r', 'i') GROUP BY 1, 2, 3 ORDER BY 1, 2, 3;