Re: Catalog views failed to show partitioned table information.

From: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>
To: Michael Paquier <michael(at)paquier(dot)xyz>, Suraj Kharage <suraj(dot)kharage(at)enterprisedb(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Catalog views failed to show partitioned table information.
Date: 2018-12-17 01:22:28
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


On 2018/12/15 8:00, Michael Paquier wrote:
> On Fri, Dec 14, 2018 at 05:21:49PM +0530, Suraj Kharage wrote:
>> There are some catalog views which do not show the partitioned table and
>> its index entry.
>> One of them is "pg_indexes" which failed to show the partitioned index.
>> Attached the patch which fixes the same.
> I tend to agree with your comment here. pg_tables lists partitioned
> tables, but pg_indexes is forgotting about partitioned indexes. So this
> is a good thing to add.


>> Other views such as pg_stat*,pg_statio_* has the same problem for
>> partitioned tables and indexes.
>> Since the partitioned tables and its indexes considered as a dummy, they do
>> not have any significance in stat tables,
>> can we still consider adding relkind=p in these pg_stat_* views? Thoughts?
> I am less sure about that as partitioned relations do not have a
> physical presence.

Hmm, although most of the fields of pg_stat_user_tables would be NULL or 0
for partitioned tables/indexes, values of at least some of the fields of
pg_stat_user_tables, like last_vacuum, last_analyze, etc., might be useful
to users. Also, we cannot assume that these views will continue to be
mostly useless as far as partitioned relations are concerned.


In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2018-12-17 01:40:53 Re: Should new partitions inherit their tablespace from their parent?
Previous Message Kuroda, Hayato 2018-12-17 00:43:56 DECLARE STATEMENT Syntax support