Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ecqB8-0001Bl-0y for pgsql-hackers@arkaria.postgresql.org; Sat, 20 Jan 2018 10:15:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ecqB7-0007rd-11 for pgsql-hackers@arkaria.postgresql.org; Sat, 20 Jan 2018 10:15:13 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ecqB6-0007qc-EA for pgsql-hackers@lists.postgresql.org; Sat, 20 Jan 2018 10:15:12 +0000 Received: from mail-pf0-x242.google.com ([2607:f8b0:400e:c00::242]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ecqB1-0002CC-5w for pgsql-hackers@postgresql.org; Sat, 20 Jan 2018 10:15:10 +0000 Received: by mail-pf0-x242.google.com with SMTP id y5so3276823pff.13 for ; Sat, 20 Jan 2018 02:15:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=YZTK8GKEzhMfBVXi4VCP0OqoaD/W2nigTQ8TP+LdETA=; b=Md6JnEdEgEKGfDwr4eXAJ/xVfiFmOn6ZvRhhIBCMVXdFHmzOctnViYYxd1cvXbwTfF JvAjRrVkzA5tsRS/uYT0WhvD0EIaRn7iVQBmVuzJclyuIlSe3+Iz3/WEkPwt0Uz9qbD5 X8VsNEfWyep2D4kxFD9da52xqRJQbrFJJfCSp7OenmvqD6N4b5/SLv1BFh2UlEla83MS BqT594ewFIUltSeVNpmBiS9iF1Agh1EquXL3SiiKTK4k+nS0uIXkI4y02kqzxYcK+HDN 2Ow6Y59L5h92Qvgvyh5vyd9Xj4ShTrP81cj+rf+KwRxPqOPyXobG1rHZ8+ShIVa8jHmK RDcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=YZTK8GKEzhMfBVXi4VCP0OqoaD/W2nigTQ8TP+LdETA=; b=ln73PC5yoUytxeWViEuIy7RufXrbbRetSRV6Z/J/3gdVrDVdMKSXpWsHtxiWc38CsJ NLf59eLmrFJqxc5VSHgjZr41nq3KuU5V3nwIMMI8EXlIXjuAYjD1vmRvIiU/MP7s/b7t GJZaIiqSlb6lppz9BdBuDowIhZ3ZZW1fGzumOej8aY81nFrxqsSbxPHAhTaSl6FKRwgt PpUbOZDZZSsDgYCgm2zKEDORdH1GVE4++X6CSa20gNRx+SbI22svdMI3wnhrEzn8UBqd XMj9fnfdR7p7prNMxFTuWuDPuQ1S/oeeFkft3BtEGNL6ROpxdI8bajUGAMDXZVffN8lj ip9w== X-Gm-Message-State: AKwxytfMB+ERn9FLfLgpZ/rO1VjdxgejYebEx+N3Tb7V60PGrBYVVj/n CFp702omzvYRSbhzyaa8+W4= X-Google-Smtp-Source: AH8x224lUHg3j9SsWVEKFKwZZPhPmVcu9hgfct8gl6Sl9z6Q/d8YwzXy5luFNwYdMD9xrNoRdD8TIg== X-Received: by 10.98.242.77 with SMTP id y13mr1780826pfl.156.1516443305326; Sat, 20 Jan 2018 02:15:05 -0800 (PST) Received: from paquier.xyz (c137162.net61215.cablenet.ne.jp. [61.215.137.162]) by smtp.gmail.com with ESMTPSA id q6sm18698883pgv.72.2018.01.20.02.15.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 20 Jan 2018 02:15:03 -0800 (PST) Date: Sat, 20 Jan 2018 19:14:54 +0900 From: Michael Paquier To: Amit Langote Cc: Peter Eisentraut , David Rowley , Robert Haas , Pg Hackers Subject: Re: [Sender Address Forgery]Re: pg_(total_)relation_size and partitioned tables Message-ID: <20180120101454.GA1311@paquier.xyz> References: <1a78dea4-36b7-afb7-b3f3-1b4ff319fbb4@lab.ntt.co.jp> <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> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="cWoXeonUoKmBZSoM" Content-Disposition: inline In-Reply-To: <7a9c5328-5328-52a3-2a3d-bf1434b4dd1d@lab.ntt.co.jp> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --cWoXeonUoKmBZSoM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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? >=20 > Perhaps, like the following (roughly implemented in the attached)? >=20 > 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 :) >=20 > OK, I will add those things in the next version. Thanks. -- Michael --cWoXeonUoKmBZSoM Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAlpjFp4ACgkQnvQgOdby QH3muBAAm1HZ+WAzYyc5kYr8b3XcpiOe+J3DtPvGuW6UxoQ8jp9J2WTWMFhFUEr/ ohtzX0YdT5pAYEwIKV+n9oBM2el3EmG7VSbgcD5IkGeEDJ4cn8k+bg8BaT4rCbui c3NRvK+0BixAoqftna3q3QB/fUjyfGlio+CnQAGNRZ3ChCIhpEXQePN/o6FFHDyu fS5vaKpQMQCjZarAVIhhXwtRn4rM7RFjmlsAN3HLsCYAWCC0sb+Sa4TD+f5dJRV7 O/Gsod2Oz4O4NCs5iyUARxVIXoeKewloUvif2iZRH+dSSUX81JrN9SpYdfXUh4lo newZ93QYV9LB6i5+WshjmVhnB3ax6tdIs2e6zaWmJL5ytNO03NMzYs+mblJ1C+2o ik9fuKVRi9B8oUJ08iPKasin+1fl3zhXAW6iy+2LjYByGySaZaqZhWV/+ygfWMtk xR7XwKFqpC8P6GT8e7hcJAXU3Fd/QBh/1ecV9OMkAUCxpU/aJRwRJ0XoRp5LdPh6 ELCC/+UiFSRA+htUZj4rOPaTccLCVPmeOXd1Qp9Sy+lHfACdzFMyiI2yWrbv2ARi VMkCrs7gXLZfn8ArqDBSJkyEZ8gyZ7F5CUumS2dPUpHnYjymZO3pOxdOLb9YKhoT auB0NHtLY/oLoIEadN41byQFnglOz2Ir2QAJEEeAld4NL79lVU0= =K4jI -----END PGP SIGNATURE----- --cWoXeonUoKmBZSoM--