I am sending a prototype of patch. Now, it calculates size of partitioned tables with recursive query. When any more simple method will be possible, the size calculation will be changed.
postgres=# \dt+ List of relations +--------+------------+-------+-------+---------+-------------+ | Schema | Name | Type | Owner | Size | Description | +--------+------------+-------+-------+---------+-------------+ | public | data | table | pavel | 0 bytes | | | public | data_2016 | table | pavel | 15 MB | | | public | data_2017 | table | pavel | 15 MB | | | public | data_other | table | pavel | 11 MB | | +--------+------------+-------+-------+---------+-------------+ (4 rows)
postgres=# \dP+ List of partitioned tables +--------+------+-------+-------+-------------+ | Schema | Name | Owner | Size | Description | +--------+------+-------+-------+-------------+ | public | data | pavel | 42 MB | | +--------+------+-------+-------+-------------+ (1 row)
Regards
Pavel
p.s. Another patch can be replacement of relation type from "table" to "partitioned table"
postgres=# \dt+ List of relations +--------+------------+-------------------+-------+---------+-------------+ | Schema | Name | Type | Owner | Size | Description | +--------+------------+-------------------+-------+---------+-------------+ | public | data | partitioned table | pavel | 0 bytes | | | public | data_2016 | table | pavel | 15 MB | | | public | data_2017 | table | pavel | 15 MB | | | public | data_other | table | pavel | 11 MB | | +--------+------------+-------------------+-------+---------+-------------+ (4 rows)