title: why cant see my schema size
body: <p>If you google for "postgresql table size" you get this nice query. <a href="https://wiki.postgresql.org/wiki/Disk_Usage" rel="nofollow noreferrer">https://wiki.postgresql.org/wiki/Disk_Usage</a></p>
  
  <pre><code>SELECT *, pg_size_pretty(total_bytes) AS total
      , pg_size_pretty(index_bytes) AS INDEX
      , pg_size_pretty(toast_bytes) AS toast
      , pg_size_pretty(table_bytes) AS TABLE
    FROM (
    SELECT *, total_bytes-index_bytes-COALESCE(toast_bytes,0) AS table_bytes FROM (
        SELECT c.oid,nspname AS table_schema, relname AS TABLE_NAME
                , c.reltuples AS row_estimate
                , pg_total_relation_size(c.oid) AS total_bytes
                , pg_indexes_size(c.oid) AS index_bytes
                , pg_total_relation_size(reltoastrelid) AS toast_bytes
            FROM pg_class c
            LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
            WHERE relkind = 'r'
    ) a
  ) a;
  </code></pre>
  
  <p>I have a schema <code>app</code>:</p>
  
  <p><a href="https://i.stack.imgur.com/nDYn0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nDYn0.png" alt="enter image description here"></a></p>
  
  <p>But doesnt show in the result:</p>
  
  <p><a href="https://i.stack.imgur.com/NTu3g.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NTu3g.png" alt="enter image description here"></a></p>
  
  <p><strong>Why <code>app</code> schema doesnt show in the result?</strong></p>
  
  <p>I try a second <a href="https://stackoverflow.com/questions/21738408/postgresql-list-and-order-tables-by-size"><strong>query</strong></a>, and also returm empty result.</p>
  
  <pre><code>select table_name, pg_relation_size(table_name)
  from information_schema.tables
  where table_schema = 'app'
  order by 2
  </code></pre>