pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jesper Pedersen <jesper.pedersen@redhat.com>
To: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: Jeevan Ladhe <jeevan.ladhe@enterprisedb.com>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>
Subject: Re: partition tree inspection functions
Date: Tue, 7 Aug 2018 08:14:08 -0400
Message-ID: <8d200fc4-dda4-f4ee-4f9c-efdb05a12e59@redhat.com> (raw)
In-Reply-To: <5e91cf39-4727-903a-779c-7b7b081ac7e9@lab.ntt.co.jp>
References: <8d00e51a-9a51-ad02-d53e-ba6bf50b2e52@lab.ntt.co.jp>
	<5a560c9c-3722-1914-f34b-1de0ff3310d1@lab.ntt.co.jp>
	<CAOgcT0P8FC4Sat1ytVZgm09qd2bgMv-7pWpvU1HdBMKSah9r-w@mail.gmail.com>
	<d5f5b9a8-0c88-8043-2007-be37096bed39@lab.ntt.co.jp>
	<20180627121615.GF2667@paquier.xyz>
	<45e28062-976d-45bf-56f8-9746f551da02@lab.ntt.co.jp>
	<20180628034341.GH11054@paquier.xyz>
	<6baeb45a-6222-6b88-342d-37fc7d3cf89a@lab.ntt.co.jp>
	<4f4a2518-6c62-5463-6ac2-1241ae9d6041@redhat.com>
	<e12ff710-dcf5-18ff-b4a4-cc42432d84c4@lab.ntt.co.jp>
	<38183355-ea7c-9443-0c38-6124fcf5f38b@redhat.com>
	<5686970f-b4e8-bbe5-9109-b97763714c19@lab.ntt.co.jp>
	<da9f8b6d-13bb-18fe-7777-b3be7bdd327b@redhat.com>
	<3273a7af-3aca-eb86-cedb-f7b28be00831@lab.ntt.co.jp>
	<CA+TgmobhiREgUvKuMOoCCsPC6orjWKt_XoSd5shhCL7QVo8=Ag@mail.gmail.com>
	<28d6f8eb-afda-1bfd-141d-ca489cffb0ee@lab.ntt.co.jp>
	<7f2e6674-9196-9fe7-1405-368bafd64198@redhat.com>
	<5e91cf39-4727-903a-779c-7b7b081ac7e9@lab.ntt.co.jp>

Hi,

On 08/07/2018 03:32 AM, Amit Langote wrote:
> Do we need a pg_partition_level that expects the individual partition OID
> to be passed to it or can we do with the information we get from the
> revised pg_partition_children?  In earlier revisions,
> pg_partition_children returned only the partition OIDs, so we needed to
> provide pg_partition_* functions for getting the parent, root parent,
> level, etc. separately.  I mean to ask if is there a need for having these
> functions separately if the revised pg_partition_children already outputs
> that information?
>

I'm thinking of the case where we only have information about a leaf 
partition, and we need its root partition and the actual level in the 
partition tree.

If we had

  SELECT pg_partition_root_parent('leafpart');

and

  SELECT pg_partition_level('leafpart');

-- we don't need the pg_partition_level('leafpart', 'parentpart') 
function now.

We can use pg_partition_children() for the rest.

> pg_partition_leaf_children()'s output can be obtained as follows, after
> adding isleaf column to pg_partition_children's output:
>

Yes, this is great.

Thanks !

Best regards,
  Jesper




view thread (74+ messages)  latest in thread

Message-ID: <8d200fc4-dda4-f4ee-4f9c-efdb05a12e59@redhat.com>
Permalink:  ../8d200fc4-dda4-f4ee-4f9c-efdb05a12e59@redhat.com/
Also on:    postgresql.org/message-id/8d200fc4-dda4-f4ee-4f9c-efdb05a12e59@redhat.com

 · 

reply

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-hackers@postgresql.org
  Cc: jesper.pedersen@redhat.com, Langote_Amit_f8@lab.ntt.co.jp, robertmhaas@gmail.com, michael@paquier.xyz, jeevan.ladhe@enterprisedb.com
  Subject: Re: partition tree inspection functions
  In-Reply-To: <8d200fc4-dda4-f4ee-4f9c-efdb05a12e59@redhat.com>

* 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