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.96) (envelope-from ) id 1w9KIJ-001LhP-2p for pgsql-novice@arkaria.postgresql.org; Sun, 05 Apr 2026 10:01:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w9KII-002FUs-0k for pgsql-novice@arkaria.postgresql.org; Sun, 05 Apr 2026 10:01:26 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w9KIH-002FUj-39 for pgsql-novice@lists.postgresql.org; Sun, 05 Apr 2026 10:01:26 +0000 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w9KIG-00000000f12-1ztg for pgsql-novice@lists.postgresql.org; Sun, 05 Apr 2026 10:01:25 +0000 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-2a871daa98fso25268845ad.1 for ; Sun, 05 Apr 2026 03:01:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1775383284; cv=none; d=google.com; s=arc-20240605; b=ZQxVgRafxtljWERnd5coZ6B9SLEKAOrduyPqyeJfyC+eMUoIBOlmzWafV0bh3UU9j5 T6ui8Kf1OVESbzyEYL7Ua5P8SVtfKtcEGzvOy4Rkmtpn9vI/4IaZwrTUv0a/FaY/Rha9 cJLVD9Wxq9cPqw+/SYtkdkuoFzn/lfF9eZ7FobUBC19qd2ISXMKS/o9vZfCXwg4gKNFx ipFdMR7nOkH+N8qoxmIB75DByTlOksGLci80wtnVVZBvApTE40R06YyrUMhVdyLO4zBL txsrv50CI7c1nQR+jdTXrkdC9y4I43HEgl2bbEdbSOr5IAmy9CwTFhASjgUAsEqrUzVQ 7rJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=9xbiQ2vkXuol5odH+HdfbjBNFNibtrvJ/JE7AQBxnjo=; fh=bHy7pW4hFvJq+8oDcIPZi/0cxOFslsmKDA2f+HyrPrE=; b=gJ6jRfzzVNc3D9N4kuRLnmAwIYuN74Uqc2gd1nwxG7UebI0WVb8ER4ua938ubMy/19 rzPVj+x0B7WqNydIbvD19DVvvrysmGTDC87jHmphuAN3PduAmiuFuVUAQNXs9Jz1dPd7 5zjP3Bt6KbgbXQFJhTGFYXhSNYWhazZVURjBvyacWQStHHTgexxz4DRJKt9sPb9Md9cB e2MUFS5Z2DB+EcE+gdHRhttupV8Rt4PHPGJUwcRvCxV1lL349Yc+z48lnAE7/+704tfc k22e7fZbEX9ltVCyick4W5HijUsd7lp4J06Avi4DNaTnMozx+sJQJZPTtl1WgIQKtDPU kqZQ==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775383284; x=1775988084; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=9xbiQ2vkXuol5odH+HdfbjBNFNibtrvJ/JE7AQBxnjo=; b=GXAwRGmqP+0d0RYNUhr9zBH9tcPniwpa0xZ7r/WhMOOpUrvFOumfd5+BnZRfVznsoQ 0iFg4yYAd4slr6Z69w2TLoBBSG2N93l5pRtJJEr4153PC9SKCQs9Mu7GxtVhzUlTZEei TgQZmkqdjLKBQFRZkXLmMkF/nXPmjTL5ZHFF7uTEpexegwMdvmwbAxARLYbFJSY10an4 hlEYK0tKETOyUPSHivOHmMgZ7vIQDnkvc0lFnC6fq5mA8jC9ycNvvDLJ+YBlnyKZa+dA d2lrkBDjkzwnHiMESjYnW5QM0JYR4Lvqwh/c34gc+Q/Rwk4hMwF5bALXHVcmLQc1BDuh 3dVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775383284; x=1775988084; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=9xbiQ2vkXuol5odH+HdfbjBNFNibtrvJ/JE7AQBxnjo=; b=sUMZuwVVYhjAXKLy4aRNKS6vcqHSyAAmqJAjAGlzpwgcERDUXnLE7BjoVu/k82+JFn gZqYd0pWF1/t7BvT6K/5GoNJSft8DMdqdxCl00C6TsTX+X8QzOzWI+isjjbUONHsl6rz WTFg6SKltpxMPzenFQJOGP0uxx+yxxjBT0yBtNWkBIpurDp7/NsFrYPpvjeenU6bX8po h0OmiUCPMwhOa5hK4jqciXUQi0MftmaxbSWUU5Y7Jf4aq7FHtnofhzNnGopCIFPzO1eu TKi/uQSgwykvDm/OCzNbOQDmbcJvY79pustwJUzAdy6ZBB3H6m5J9CjRiAPoYj8dxW33 u2rA== X-Forwarded-Encrypted: i=1; AJvYcCU7bl9EE4RjSavcLLtBIRhA37D67n8a6j7+Mtb+o6SBquDq9e2FncjwhP4N5MEjV0Z9BQBbO1zgfkWXYDA=@lists.postgresql.org X-Gm-Message-State: AOJu0YzdIwu6mitgEiNtyJ2ke1+4VPBUVHMpOcxyo3ku+nf2Tbo83BFY DJU9A8XFeXAnHR3rpZETuXUL3JPnm3OGzG33WVXn8OhuDrhnGTJCRGqgiJGEvff9VVuGKEuw8Fk KZq5VMrnZ/ta7d7cgJy24Jgsrs/XgrRk= X-Gm-Gg: AeBDietP2SBLnieoH/fpAQCUnV/HAgtSenXerhNDB5C1QjDoUQw9c8JeTqLkBZxP2D1 1QWWKbusvCsqwDOjSVx93z4us5du8wjpZMKxZDNFnbrb4nG/A9kLwS3VAJEce21/OHqGF2Kfx9o oolcdeSkAc1N7a6w9LwggeaSae1MaJfY+nG/mZ7BKoBhyB8jVtjsI4/Ad3sC9iGIZf4bap+9Tr6 bQaPQMyUDHsRL7zBdPrK9BJAIC1ncoDDurN3ereSA66uvJh/uNU2ssmgtslKoU9YyXaeCSbIvoC lYAYrQ86VaTA6zWFJ3MO5qJ/rcskWyZRr65xesqQ X-Received: by 2002:a17:902:ce0a:b0:2b0:b1e7:8841 with SMTP id d9443c01a7336-2b28181a0aemr92382635ad.32.1775383283525; Sun, 05 Apr 2026 03:01:23 -0700 (PDT) MIME-Version: 1.0 References: <2006840.1774881078@sss.pgh.pa.us> In-Reply-To: From: Ibrahim Shaame Date: Sun, 5 Apr 2026 13:01:09 +0300 X-Gm-Features: AQROBzCCBbCTjtIG-fJmG9On5yu-yNcb-QzkBCUFXKS2Ba00-gjWA_t3dVMQZm8 Message-ID: Subject: Re: Adding column in a recursive query To: "David G. Johnston" Cc: Tom Lane , "depesz@depesz.com" , "pgsql-novice@lists.postgresql.org" Content-Type: multipart/alternative; boundary="000000000000f46d1e064eb3a1d0" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000f46d1e064eb3a1d0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thank you David for clarifying . Ibrahim Shaame On Mon, Mar 30, 2026 at 6:18=E2=80=AFPM David G. Johnston < david.g.johnston@gmail.com> wrote: > On Monday, March 30, 2026, Ibrahim Shaame wrote: > >> Effectively, after removing the column names from x(jina, namba, >> nasaba_1) it works now. Thank you very much. But then I don't understand >> the advantage or inconvenience of naming or not naming the columns there= . >> Is there any explanation somewhere? >> > > SQL is big on providing ways to give aliases/names to things. It just > boils down to readability or, more often, conventions, as to which ones t= o > use. The CTE column names clause doesn=E2=80=99t get used much that I ha= ve seen. > You have to write a full query inside the CTE anyway so column aliases ar= e > more conventional. > > David J. > --000000000000f46d1e064eb3a1d0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thank you David for clarifying

.
Ibrahim Shaame

On Mon, Mar 30, 20= 26 at 6:18=E2=80=AFPM David G. Johnston <david.g.johnston@gmail.com> wrote:
On Monday, March 30, 2026, Ibrahim= Shaame <ishaame@= gmail.com> wrote:
Effectively, after removing the column names from = x(jina, namba, nasaba_1) it works now. Thank you very much. But then = I don't understand the advantage or inconvenience=C2=A0of naming or not= naming the columns there. Is there any explanation somewhere?
=

SQL is big on providing w= ays to give aliases/names to things.=C2=A0 It just boils down to readabilit= y or, more often, conventions, as to which ones to use.=C2=A0 The CTE colum= n names clause doesn=E2=80=99t get used much that I have seen.=C2=A0 You ha= ve to write a full query inside the CTE anyway so column aliases are more c= onventional.

David J.=C2=A0
--000000000000f46d1e064eb3a1d0--