pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael.paquier@gmail.com>
To: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: David Rowley <david.rowley@2ndquadrant.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>
Subject: Re: [Sender Address Forgery]Re: pg_(total_)relation_size and partitioned tables
Date: Sat, 20 Jan 2018 19:14:54 +0900
Message-ID: <20180120101454.GA1311@paquier.xyz> (raw)
In-Reply-To: <7a9c5328-5328-52a3-2a3d-bf1434b4dd1d@lab.ntt.co.jp>
References: <CAKJS1f9Rev615s4k7JhUsqwu-3CjR0xB2F0qpZ5fvQe+mxke0w@mail.gmail.com>
	<CAB7nPqQtNv5DLD9pXMWcT2VcsJqOnRUNBKekAapYiJxV4t=tyg@mail.gmail.com>
	<CAB7nPqTKy7HRpUM0_vMjGPkM6h6pR86Aegsw+MTmzxWr3-D-tg@mail.gmail.com>
	<1a78dea4-36b7-afb7-b3f3-1b4ff319fbb4@lab.ntt.co.jp>
	<d5323242-b571-9317-1e5b-ee5fd96c2f4a@2ndquadrant.com>
	<CAKJS1f86CjuW7-6QaXKPZLtcVCMo=ocprNdSk+dcvbpPyXMxtQ@mail.gmail.com>
	<93bef1b2-2ed0-c257-158e-efdf5b0ff9dd@2ndquadrant.com>
	<8ecdd7fb-02d5-4322-526a-e49e2de25064@lab.ntt.co.jp>
	<20180119053958.GD12826@paquier.xyz>
	<7a9c5328-5328-52a3-2a3d-bf1434b4dd1d@lab.ntt.co.jp>

On Fri, Jan 19, 2018 at 06:28:41PM +0900, Amit Langote wrote:
> Do you mean pg_partition_tree(regclass), that returns all partitions in
> the partition tree whose root is passed as the parameter?
> 
> Perhaps, like the following (roughly implemented in the attached)?
> 
> select  pg_partition_root(p) as root_parent,
>         pg_partition_parent(p) as parent,
>         p as relname,
>         pg_total_relation_size(p) as size
> from    pg_partition_tree_tables('p') p
> order by 4;
>  root_parent | parent | relname |  size
> -------------+--------+---------+---------
>  p           |        | p       |       0
>  p           | p      | p123    |       0
>  p           | p123   | p12     |       0
>  p           | p123   | p3      | 3653632
>  p           | p12    | p1      | 3653632
>  p           | p12    | p2      | 3653632
> (6 rows)

It seems that you caught the idea. As long as each leaf and root is
listed uniquely, that would be acceptable to me, and useful for users.
If pg_partition_tree_tables() uses the top of the partition as input,
all the tree should show up. If you use a leaf, anything under the leaf
should show up. If a leaf is defined and it has no underlying leaves,
then only this outmost leaf should be listed.

+/*
+ * Returns Oids of tables in a publication.
+ */
Close enough, but that's not a publication.

>> Documentation, as well as regression tests, would be welcome :)
> 
> OK, I will add those things in the next version.

Thanks.
--
Michael

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (25+ messages)  latest in thread

Message-ID: <20180120101454.GA1311@paquier.xyz>
Permalink:  ../20180120101454.GA1311@paquier.xyz/
Also on:    postgresql.org/message-id/20180120101454.GA1311@paquier.xyz

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: michael.paquier@gmail.com, Langote_Amit_f8@lab.ntt.co.jp, peter.eisentraut@2ndquadrant.com, david.rowley@2ndquadrant.com, robertmhaas@gmail.com
  Subject: Re: [Sender Address Forgery]Re: pg_(total_)relation_size and partitioned tables
  In-Reply-To: <20180120101454.GA1311@paquier.xyz>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox