Re: pg_relation_size on partitioned table

2022-03-26 Thread Japin Li
On Sat, 26 Mar 2022 at 22:16, Bharath Rupireddy wrote: > On Sat, Mar 26, 2022 at 11:35 AM Michael Paquier wrote: >> >> On Fri, Mar 25, 2022 at 08:52:40PM +0800, Japin Li wrote: >> > Could we provide a function to get the total size of the partition table >> > though the partitioned table name?

Re: pg_relation_size on partitioned table

2022-03-26 Thread Bharath Rupireddy
On Sat, Mar 26, 2022 at 11:35 AM Michael Paquier wrote: > > On Fri, Mar 25, 2022 at 08:52:40PM +0800, Japin Li wrote: > > Could we provide a function to get the total size of the partition table > > though the partitioned table name? Maybe we can extend > > the pg_relation_size() to get the total

Re: pg_relation_size on partitioned table

2022-03-25 Thread Michael Paquier
On Fri, Mar 25, 2022 at 08:52:40PM +0800, Japin Li wrote: > Could we provide a function to get the total size of the partition table > though the partitioned table name? Maybe we can extend > the pg_relation_size() to get the total size of partition tables through > the partitioned table name. Th

Re: pg_relation_size on partitioned table

2022-03-25 Thread Justin Pryzby
On Fri, Mar 25, 2022 at 08:52:40PM +0800, Japin Li wrote: > When I try to get total size of partition tables though partitioned table > name using pg_relation_size(), it always returns zero. I can use the > following SQL to get total size of partition tables, however, it is a bit > complex. This

Re: pg_relation_size on partitioned table

2022-03-25 Thread Japin Li
On Fri, 25 Mar 2022 at 21:21, Bharath Rupireddy wrote: > On Fri, Mar 25, 2022 at 6:23 PM Japin Li wrote: >> >> Hi, hackers >> >> When I try to get total size of partition tables though partitioned table >> name using pg_relation_size(), it always returns zero. I can use the >> following SQL to

Re: pg_relation_size on partitioned table

2022-03-25 Thread Bharath Rupireddy
On Fri, Mar 25, 2022 at 6:23 PM Japin Li wrote: > > Hi, hackers > > When I try to get total size of partition tables though partitioned table > name using pg_relation_size(), it always returns zero. I can use the > following SQL to get total size of partition tables, however, it is a bit > comple

Re: pg_relation_size on partitioned table

2022-03-25 Thread Japin Li
On Fri, 25 Mar 2022 at 21:21, Bharath Rupireddy wrote: > On Fri, Mar 25, 2022 at 6:23 PM Japin Li wrote: >> >> Hi, hackers >> >> When I try to get total size of partition tables though partitioned table >> name using pg_relation_size(), it always returns zero. I can use the >> following SQL t

Re: pg_relation_size on partitioned table

2022-03-25 Thread Japin Li
On Fri, 25 Mar 2022 at 20:59, Alvaro Herrera wrote: > On 2022-Mar-25, Japin Li wrote: > >> Could we provide a function to get the total size of the partition table >> though the partitioned table name? Maybe we can extend >> the pg_relation_size() to get the total size of partition tables throu

Re: pg_relation_size on partitioned table

2022-03-25 Thread Alvaro Herrera
On 2022-Mar-25, Japin Li wrote: > Could we provide a function to get the total size of the partition table > though the partitioned table name? Maybe we can extend > the pg_relation_size() to get the total size of partition tables through > the partitioned table name. Does \dP+ do what you need?

pg_relation_size on partitioned table

2022-03-25 Thread Japin Li
Hi, hackers When I try to get total size of partition tables though partitioned table name using pg_relation_size(), it always returns zero. I can use the following SQL to get total size of partition tables, however, it is a bit complex. SELECT pg_size_pretty(sum(pg_relation_size(i