Re: How to list partitions of a table in PostgreSQL 10

From: Stephen Froehlich <s(dot)froehlich(at)cablelabs(dot)com>
To: "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: How to list partitions of a table in PostgreSQL 10
Date: 2017-10-31 19:59:59
Message-ID: CY1PR0601MB19273A4035E6D24B025ED459E55E0@CY1PR0601MB1927.namprd06.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

I have discovered a simple query that will tell me if a table is a registered partition or not, which meets my purposes for now, but a list of partitions of a given table would be better:

SELECT 1 FROM pg_class WHERE relname = '[attached_partition_name_here]' AND relpartbound IS NOT NULL;

--Stephen

From: pgsql-novice-owner(at)postgresql(dot)org [mailto:pgsql-novice-owner(at)postgresql(dot)org] On Behalf Of Stephen Froehlich
Sent: Tuesday, October 31, 2017 1:02 PM
To: pgsql-novice(at)postgresql(dot)org
Subject: [NOVICE] How to list partitions of a table in PostgreSQL 10

This sender failed our fraud detection checks and may not be who they appear to be. Learn about spoofing<http://aka.ms/LearnAboutSpoofing>

Feedback<http://aka.ms/SafetyTipsFeedback>

CableLabs WARNING: The sender of this email could not be validated and may not match the person in the "From" field.
What is the syntax to get a list of the partitions of a table in PostgreSQL 10?

Thanks,
Stephen

Stephen Froehlich
Sr. Strategist, CableLabs(r)

s(dot)froehlich(at)cablelabs(dot)com<mailto:s(dot)froehlich(at)cablelabs(dot)com>
Tel: +1 (303) 661-3708

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Thomas Kellerer 2017-10-31 20:10:24 Re: How to list partitions of a table in PostgreSQL 10
Previous Message Stephen Froehlich 2017-10-31 19:01:50 How to list partitions of a table in PostgreSQL 10