From: Bruce Momjian <bruce@momjian.us>
To: michal.palenik@freemap.sk
To: pgsql-docs@lists.postgresql.org
Subject: Re: getting table name from partition
Date: Thu, 29 Jul 2021 18:24:17 -0400
Message-ID: <20210729222417.GW9600@momjian.us> (raw)
In-Reply-To: <162627031219.693.11508199541771263335@wrigleys.postgresql.org>
References: <162627031219.693.11508199541771263335@wrigleys.postgresql.org>
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 <bruce@momjian.us> https://momjian.us
EDB https://enterprisedb.com
If only the physical world exists, free will is an illusion.
Attachments:
[text/x-diff] tableoid.diff (608B, ../20210729222417.GW9600@momjian.us/2-tableoid.diff)
download | inline diff:diff --git a/doc/src/sgml/ddl.sgml b/doc/src/sgml/ddl.sgmlindex 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
<para>
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,+ <structfield>tableoid</structfield> and all the normal rules of
inheritance apply as described in <xref linkend="ddl-inherit"/>, with
a few exceptions:
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-docs@postgresql.org
Cc: bruce@momjian.us, michal.palenik@freemap.sk, pgsql-docs@lists.postgresql.org
Subject: Re: getting table name from partition
In-Reply-To: <20210729222417.GW9600@momjian.us>
* 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