<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Pg_partition_tree on Postgres Scripts</title><link>https://www.postgresscripts.com/tags/pg_partition_tree/</link><description>Recent content in Pg_partition_tree on Postgres Scripts</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>PostgresScripts.com</copyright><lastBuildDate>Thu, 09 Apr 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://www.postgresscripts.com/tags/pg_partition_tree/index.xml" rel="self" type="application/rss+xml"/><item><title>List PostgreSQL Partitioned Tables with SQL</title><link>https://www.postgresscripts.com/post/list-postgresql-partitioned-tables/</link><pubDate>Thu, 09 Apr 2026 00:00:00 +0000</pubDate><guid>https://www.postgresscripts.com/post/list-postgresql-partitioned-tables/</guid><description>
&lt;h2 id="list-partitioned-and-ordinary-tables-in-postgresql"&gt;List Partitioned and Ordinary Tables in PostgreSQL&lt;/h2&gt;
&lt;p&gt;Before you change a retention job, plan a migration, or add a partition for next month, you need a plain list of which tables are partitioned and which are not. &lt;code&gt;pg_class&lt;/code&gt; joined to &lt;code&gt;pg_namespace&lt;/code&gt; gives that list for the whole database in one query, and a count from &lt;code&gt;pg_inherits&lt;/code&gt; shows how many partitions sit under each parent.&lt;/p&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="7945792173"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;h2 id="purpose-and-overview"&gt;Purpose and Overview&lt;/h2&gt;
&lt;p&gt;Declarative partitioning splits one logical table into many physical pieces. The parent — the partitioned table — holds no rows itself; the PostgreSQL documentation calls it a &amp;quot;virtual&amp;quot; table with no storage of its own. The rows live in its partitions, which are ordinary tables tied to the parent by their partition bounds. On a mature database it is easy to lose track of which large tables were partitioned, which were not, and which partitioning work was never finished.&lt;/p&gt;</description></item></channel></rss>