Re: BUG #15245: pg_stat_all_tables does not include partition master tables - Mailing list pgsql-bugs

From David Rowley
Subject Re: BUG #15245: pg_stat_all_tables does not include partition master tables
Date
Msg-id CAKJS1f9cAMbXym0UE0U_Zfg_qEdnm=RJWPDnEHdU5o3vAGE2Kg@mail.gmail.com
Whole thread Raw
In response to BUG #15245: pg_stat_all_tables does not include partition mastertables  (PG Bug reporting form <noreply@postgresql.org>)
Responses Re: BUG #15245: pg_stat_all_tables does not include partition mastertables  (Michael Paquier <michael@paquier.xyz>)
List pgsql-bugs
On 17 June 2018 at 20:54, PG Bug reporting form <noreply@postgresql.org> wrote:
> The system view pg_catalog.pg_stat_all_tables (and therefore also
> pg_catalog.pg_stat_user_tables) do not list partition master tables (CREATE
> TABLE ... PARTITION BY ..).
>
> This is because it only includes rows from pg_class with relkind IN ('r',
> 't', 'm')  (as defined in src/backend/catalog/system_views.sql).
>
> IMHO, it should also include rows with relkind = 'p'.

FWIW there was a similar discussion of whether
pg_relation_size('<partitioned table>') should report the sizes of all
its partitions in [1].  Most people seemed to vote to leave it
returning 0.

Some of the same reasoning might apply to this case.

[1] https://www.postgresql.org/message-id/495cec7e-f8d9-7e13-4807-90dbf4eec4ea@lab.ntt.co.jp

-- 
 David Rowley                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


pgsql-bugs by date:

Previous
From: Michael Paquier
Date:
Subject: Re: BUG #15245: pg_stat_all_tables does not include partition mastertables
Next
From: Michael Paquier
Date:
Subject: Re: BUG #15245: pg_stat_all_tables does not include partition mastertables