Re: ToDo: show size of partitioned table

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Amit Langote <amitlangote09(at)gmail(dot)com>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>, mathias(at)brossard(dot)org, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: ToDo: show size of partitioned table
Date: 2018-10-30 13:48:55
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, Oct 30, 2018 at 09:24:01PM +0900, Amit Langote wrote:
>> It is based on Mathias's patch. Although we can use
>> pg_partition_tree on PostgreSQL, we still should to support
>> PostgreSQL 10, 11 where this function is not available
> Ah, I forgot that psql will need to consider 10 and 11 servers too.

+ /* PostgreSQL 11 has pg_partition_tree function */
That's v12 here.

+ appendPQExpBuffer(&buf,
+ ",\n (SELECT pg_catalog.pg_size_pretty(sum(pg_catalog.pg_table_size("
+ "relid)))\n"
+ " FROM pg_partition_tree(c.oid)) AS \"%s\""
You need to do schema qualification for functions and relations.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andreas 'ads' Scherbaum 2018-10-30 13:52:22 Re: Installation instructions update (pg_ctl)
Previous Message Tom Lane 2018-10-30 13:45:34 Re: Getting fancy errors when accessing information_schema on 10.5