Re: Reporting by family tree

From: o1bigtenor <o1bigtenor(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Ibrahim Shaame <ishaame(at)gmail(dot)com>, swastik Gurung <gurung_swastik(at)yahoo(dot)com>, "pgsql-novice(at)lists(dot)postgresql(dot)org" <pgsql-novice(at)lists(dot)postgresql(dot)org>
Subject: Re: Reporting by family tree
Date: 2023-10-26 11:46:18
Message-ID: CAPpdf5-Bticw_wk_ZZiV2i7-sex87zEQoDojPsZc51-XMvtnMw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Wed, Oct 25, 2023 at 5:17 PM David G. Johnston
<david(dot)g(dot)johnston(at)gmail(dot)com> wrote:
>
> On Wed, Oct 25, 2023 at 9:13 AM o1bigtenor <o1bigtenor(at)gmail(dot)com> wrote:
>>
>> On Wed, Oct 25, 2023 at 9:55 AM David G. Johnston
>> <david(dot)g(dot)johnston(at)gmail(dot)com> wrote:
>> >
>> > On Wed, Oct 25, 2023 at 5:21 AM Ibrahim Shaame <ishaame(at)gmail(dot)com> wrote:
>> >>
>> >> But what I want to get is grandfather - father - children:
>> >>
>> >> 1 - Grandfather1
>> >>
>> >> 3 - father1-1
>> >>
>> >> 6 - son1-1
>> >>
>> >> 7 – son1-2
>> >>
>> >> 4 - Father1-2
>> >>
>> >> 8 - son2-1
>> >>
>> >> 2 – Grandfather2
>> >>
>> >> 5 - Father2-1
>> >>
>> >> etc
>> >>
>> >>
>> >> Any suggestion
>> >>
>> >
>> > If you want a different ordering of the output change the ORDER BY specification.
>> >
>> > Specifically, you want to order by the path of each person. Since that can only be determined during the traversal you need to create the path data yourself. I suggest using an integer[] (integer array) to store the path using ID values as breadcrumbs.
>> >
>> >
>> (Not the OP just someone following the list trying to learn.)
>>
>> 'using ID values as breadcrumbs' - - - can I interpret that to mean
>> the ordinal numbers 1-8 listed (more implied)?
>>
>
> Yes, the numbers 1-8 are the values assigned to these 8 example individuals as their unique identifiers.
>
> {1}
> {1,3}
> {1,3,6}
> {1,3,7}
> {1,4}
> {1,4,8}
> {2}
> {2,5}
>

Thank you Mr David.

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Ianseeks 2023-11-02 08:14:03 fail to run postgresql16 after update from postgresql13
Previous Message David G. Johnston 2023-10-25 22:16:54 Re: Reporting by family tree