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

From: Aleksey Tsalolikhin <atsaloli(dot)tech(at)gmail(dot)com>
To: Stephen Froehlich <s(dot)froehlich(at)cablelabs(dot)com>
Cc: "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: [NOVICE] How to list partitions of a table in PostgreSQL 10
Date: 2018-12-28 14:44:24
Message-ID: CA+jMWodRweBUGvUU79vK21cGduz1mOtOnxfWU5vESoGW=JEPow@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Use *\d+ tablename *in psql to list all the child tables (partitions).

On Tue, Oct 31, 2017 at 1:00 PM Stephen Froehlich <s(dot)froehlich(at)cablelabs(dot)com>
wrote:

> 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, *Cable*Labs®
>
>
> s(dot)froehlich(at)cablelabs(dot)com
>
> Tel: +1 (303) 661-3708
>
>
>

--
Achieve real learning. Email training(at)verticalsysadmin(dot)com(dot)

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Simon Connah 2018-12-28 17:15:47 Using PostgreSQL to store URLs for a web crawler
Previous Message Viorel Tabara 2018-12-23 19:49:55 ahead of time compiling in PostgreSQL?