Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qvypO-008vRr-Qh for pgsql-novice@arkaria.postgresql.org; Thu, 26 Oct 2023 11:47:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qvypM-00GTq7-Fh for pgsql-novice@arkaria.postgresql.org; Thu, 26 Oct 2023 11:47:04 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qvypM-00GTpz-6v for pgsql-novice@lists.postgresql.org; Thu, 26 Oct 2023 11:47:04 +0000 Received: from mail-lj1-x229.google.com ([2a00:1450:4864:20::229]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qvypF-002uoO-Ax for pgsql-novice@lists.postgresql.org; Thu, 26 Oct 2023 11:47:03 +0000 Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2bb9a063f26so11944651fa.2 for ; Thu, 26 Oct 2023 04:46:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698320815; x=1698925615; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=pnzIPpBjw3QYOpRgEGLwyRAqWlaTb3kAkF/Sliz7d5E=; b=NhYkUTfDtZf9l/Aoy3Yx23bsrTpi25if7ZO9fmiguHPRVPmd84lnzEHI47s/OyTTAC frFoskznaBkTTXo1LscsKtX7RseL5KEOo1rT3X2cQ4z8zATvCXANwIwqQtgcahmB0XO2 GVsiVy0JdCSisvDpDutH+CDz4M1NIuf0dE21P/HDG96HBdDvIA/+IYeBd4p5Ld6KUCLb mClcdME5haNsJa34dd6k1p8S27WKdT/yMQ5XXSDoGmKohNvALjeH9xr11u4vRIPGwvpI Bl1xc8ojwlc5Rk/tzCW2d9sbD0B+/mVQ/0F5lJGiGC/srBIYcVpYyrdxUgxykH46yZkz RBTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698320815; x=1698925615; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pnzIPpBjw3QYOpRgEGLwyRAqWlaTb3kAkF/Sliz7d5E=; b=N8xeRGZ/xubsif+vAShecWMmzWgztIeqK7HQF/hdNKMIcUS5YUkN1eeax5D9dPAXTA Go/xn+wNhP3l8bfEXtq10Yjt95baSN2kx1qE+4S1RNrTUivVaplV9f3/Xf6xVOKikGwn fkNaSMZIQUnj72VwRWV0qZR84HbKg7TNPQn8RL2OEqGJKR+4xBX3sKb9shzr5IF7JgS0 pk5gi1pmkDpVTV0FFxcGimgOUPC7gAPt/3IkWeJY+m/0uaSz8uxZHWGsVKdZwDiUiQuG JXIHvkDzfa0zWssXtZy0JQRihoYBfEi3jBTmQtcIXLpshLYvlZ6eL0sXA6LCiKn7iFPX jb6w== X-Gm-Message-State: AOJu0YxxlOFXd834kHTOPjy728rH7RA8WtMUuwC7Ek3WhXkPXGS/Z77V dzUNbm30/b6sXBpnVHNnB3qnWAiCWbiQF1x+QvA= X-Google-Smtp-Source: AGHT+IFcZLVLXzDjRP259QQZYAXEVQEq1z3E9v08J9Zl3HsUj/Wt1SuaoZot1F9pBuO23SI7fp7JcgQCFhM+QdT2+WM= X-Received: by 2002:a2e:b8cc:0:b0:2c5:1f57:1ef5 with SMTP id s12-20020a2eb8cc000000b002c51f571ef5mr14304084ljp.39.1698320814966; Thu, 26 Oct 2023 04:46:54 -0700 (PDT) MIME-Version: 1.0 References: <1901532185.8873313.1696511707263@mail.yahoo.com> <1653003450.12126241.1697462972371@mail.yahoo.com> In-Reply-To: From: o1bigtenor Date: Thu, 26 Oct 2023 06:46:18 -0500 Message-ID: Subject: Re: Reporting by family tree To: "David G. Johnston" Cc: Ibrahim Shaame , swastik Gurung , "pgsql-novice@lists.postgresql.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Oct 25, 2023 at 5:17=E2=80=AFPM David G. Johnston wrote: > > On Wed, Oct 25, 2023 at 9:13=E2=80=AFAM o1bigtenor = wrote: >> >> On Wed, Oct 25, 2023 at 9:55=E2=80=AFAM David G. Johnston >> wrote: >> > >> > On Wed, Oct 25, 2023 at 5:21=E2=80=AFAM Ibrahim Shaame wrote: >> >> >> >> But what I want to get is grandfather - father - children: >> >> >> >> 1 - Grandfather1 >> >> >> >> 3 - father1-1 >> >> >> >> 6 - son1-1 >> >> >> >> 7 =E2=80=93 son1-2 >> >> >> >> 4 - Father1-2 >> >> >> >> 8 - son2-1 >> >> >> >> 2 =E2=80=93 Grandfather2 >> >> >> >> 5 - Father2-1 >> >> >> >> etc >> >> >> >> >> >> Any suggestion >> >> >> > >> > If you want a different ordering of the output change the ORDER BY spe= cification. >> > >> > Specifically, you want to order by the path of each person. Since tha= t can only be determined during the traversal you need to create the path d= ata yourself. I suggest using an integer[] (integer array) to store the pa= th 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 individua= ls 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.