Re: partition tree inspection functions

From: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>
To: jesper(dot)pedersen(at)redhat(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-07-30 09:21:54
Message-ID: 9b19de87-c810-5232-2b4d-d82bde07b6c5@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2018/07/27 21:21, Jesper Pedersen wrote:
> Hi Amit,
>
> On 07/26/2018 10:33 PM, Amit Langote wrote:
>> Optional parameter sounds good, so made it get_partition_level(regclass [
>> , regclass ]) in the updated patch.  Although, adding that argument is not
>> without possible surprises its result might evoke.  Like, what happens if
>> you try to find the level of the root table by passing a leaf partition
>> oid for the root table argument, or pass a totally unrelated table for the
>> root table argument.  For now, I've made the function return 0 for such
>> cases.
>>
>
> As 0 is a valid return value for root nodes I think we should use -1
> instead for these cases.

Makes sense, changed to be that way.

Thanks,
Amit

Attachment Content-Type Size
v7-0001-Add-assorted-partition-reporting-functions.patch text/plain 27.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Emre Hasegeli 2018-07-30 09:41:24 Re: [PATCH] Improve geometric types
Previous Message Kyotaro HORIGUCHI 2018-07-30 08:53:54 Re: BUG #15182: Canceling authentication due to timeout aka Denial of Service Attack