Re: partition tree inspection functions

From: Jesper Pedersen <jesper(dot)pedersen(at)redhat(dot)com>
To: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>, Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Jeevan Ladhe <jeevan(dot)ladhe(at)enterprisedb(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: partition tree inspection functions
Date: 2018-08-07 12:14:08
Message-ID: 8d200fc4-dda4-f4ee-4f9c-efdb05a12e59@redhat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2018-08-07 12:25:18 Re: Standby trying "restore_command" before local WAL
Previous Message Erich Schubert 2018-08-07 11:58:11 Re: BUG #15307: Low numerical precision of (Co-) Variance