Re: ToDo: show size of partitioned table - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: ToDo: show size of partitioned table
Date
Msg-id 20181030134854.GA2266@paquier.xyz
Whole thread Raw
In response to Re: ToDo: show size of partitioned table  (Amit Langote <amitlangote09@gmail.com>)
List 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.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Sergei Kornilov
Date:
Subject: Re: Continue work on changes to recovery.conf API
Next
From: Andreas 'ads' Scherbaum
Date:
Subject: Re: Installation instructions update (pg_ctl)