How do you find the disk size of a Postgres / PostgreSQL table and its indexes

前端 未结 9 2108
甜味超标
甜味超标 2020-12-02 03:42

I\'m coming to Postgres from Oracle and looking for a way to find the table and index size in terms of bytes/MB/GB/etc, or even better the size for all tables.

9条回答
  •  渐次进展
    2020-12-02 04:13

    If the database name is snort, the following sentence give it size:

    psql -c "\l+ snort" | awk -F "|" '{print $7}'
    

提交回复
热议问题