Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m9ERy-0007wM-UA for pgsql-docs@arkaria.postgresql.org; Thu, 29 Jul 2021 22:24:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m9ERx-0000XO-ID for pgsql-docs@arkaria.postgresql.org; Thu, 29 Jul 2021 22:24:21 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m9ERx-0000XG-CE for pgsql-docs@lists.postgresql.org; Thu, 29 Jul 2021 22:24:21 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m9ERv-0005ND-35 for pgsql-docs@lists.postgresql.org; Thu, 29 Jul 2021 22:24:20 +0000 Received: from bruce by momjian.us with local (Exim 4.92) (envelope-from ) id 1m9ERt-00055w-Hx; Thu, 29 Jul 2021 18:24:17 -0400 Date: Thu, 29 Jul 2021 18:24:17 -0400 From: Bruce Momjian To: michal.palenik@freemap.sk, pgsql-docs@lists.postgresql.org Subject: Re: getting table name from partition Message-ID: <20210729222417.GW9600@momjian.us> References: <162627031219.693.11508199541771263335@wrigleys.postgresql.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="hABqaeELJqnDDeDE" Content-Disposition: inline In-Reply-To: <162627031219.693.11508199541771263335@wrigleys.postgresql.org> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --hABqaeELJqnDDeDE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Jul 14, 2021 at 01:45:12PM +0000, PG Doc comments form wrote: > The following documentation comment has been logged on the website: > > Page: https://www.postgresql.org/docs/13/ddl-partitioning.html > Description: > > I would like to add a sentence like this into the description of > partitions: > > You receive the name of the partition table data is from using > tableoid::regclass as column name in the select. > > to tell the option of getting "real" tablename, eg when partitions are based > on locality. We already have this sentence in the partition docs: Since a partition hierarchy consisting of the partitioned table and its partitions is still an inheritance hierarchy, all the normal rules of inheritance apply as described in Section 5.10, with a few exceptions: but it doesn't make it clear that tableoid, which is mentioned in Section 5.10 also works, so here is a patch to add a mention of tableoid. -- Bruce Momjian https://momjian.us EDB https://enterprisedb.com If only the physical world exists, free will is an illusion. --hABqaeELJqnDDeDE Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="tableoid.diff" diff --git a/doc/src/sgml/ddl.sgml b/doc/src/sgml/ddl.sgml index 7701d8000f..e0ffb020bf 100644 --- a/doc/src/sgml/ddl.sgml +++ b/doc/src/sgml/ddl.sgml @@ -4105,7 +4105,8 @@ ALTER INDEX measurement_city_id_logdate_key Since a partition hierarchy consisting of the partitioned table and its - partitions is still an inheritance hierarchy, all the normal rules of + partitions is still an inheritance hierarchy, + tableoid and all the normal rules of inheritance apply as described in , with a few exceptions: --hABqaeELJqnDDeDE--