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 1w7ENc-0055zk-1d for pgsql-novice@arkaria.postgresql.org; Mon, 30 Mar 2026 15:18:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w7ENZ-004JOW-2S for pgsql-novice@arkaria.postgresql.org; Mon, 30 Mar 2026 15:18:14 +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 1w7ENZ-004JOO-1S for pgsql-novice@lists.postgresql.org; Mon, 30 Mar 2026 15:18:13 +0000 Received: from mail-oa1-x29.google.com ([2001:4860:4864:20::29]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w7ENY-00000001p60-07TB for pgsql-novice@lists.postgresql.org; Mon, 30 Mar 2026 15:18:12 +0000 Received: by mail-oa1-x29.google.com with SMTP id 586e51a60fabf-40ee9b945d5so3249571fac.0 for ; Mon, 30 Mar 2026 08:18:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1774883891; cv=none; d=google.com; s=arc-20240605; b=UKxG4QS39AQnXjdQOS3AD0XS6rxBEuuQg7k+S3IQpSR0jMC3zGs8bfoNmefNxJoqS5 7JDcmLZUv5Xfq0QUC45ab3EFbmu1XHncTQC7LAw+p6VdXoWFhNw+DSLrbBRfVu5O+xsz Eard3fQ58KQdGWBLCiFh9qCkk4xgaBLyGlchQF4hh+g2NVTjQ+4F+NS3cZNhwWia2bM0 6kzIq1xnH2AEAKH7hk8Z5M6zWlQDraGN4/2Cb8vytp6aKV8qTvCLj6yWfBNQbuIxYHps IVlLDE+y2m98THVQTkUNngFJF+yeiUovmzT3dG/RF/qb8xg0+E/cjWHYKccLd0wgPshm HDiQ== 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:references:in-reply-to :mime-version:dkim-signature; bh=TyMY40B/fDbOHVd/wIa0YLN3SUzRpTnqoShQvzhc1SA=; fh=nnD85v6bpFUKVAxYHZp1W2dMFQaYQsICSZn8EzNEvgQ=; b=jxTPvLOT6DSACF8JCTc0DQrbrCY4mqmSwDc83RFQqTquCCAuNQXSJN8B6xUUkmzVP4 ZrCYtfOHGbqw1hk+aklLscMg4Dm+xTIO01BukDkHMVZWqRI1PpguVFigLmZwDVoElvCG IZrtr00nITrRJsFpOYH+rMrrlkT/IWvvQqcwnIdBt0e3ucd65kj4B/ViH6W/YHe0X/YT GJ5OMMkhA9LJ54kumj0Kv/59+UYxc5U0oy+57fa5TFZN0EPTpDlOr361fk7XV1N1Tfnw gecb3cICD+8pAC5/Kdescqc86jokIAVztwh3NubBYN9DKBzjMBa01BSm7i+ZnasSMjbs C4Mg==; 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=1774883891; x=1775488691; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=TyMY40B/fDbOHVd/wIa0YLN3SUzRpTnqoShQvzhc1SA=; b=dyEIifx5Mv0eMyv4dOX3CQtKRvOxDlxmbsrXru2A/MvVgQe1LVRnNumoOwZb0uYO6s QUbpoMe0HdpkwJmXZyqTTN8v0HvZBAjuyYIVvIodXCRNaiRv5IvMZtTPOF6YSiWyGb4l uvtB1tBF21HVHAfSRxKzmQW2pHLTiqiz+a9XyxDKblgUqbYEq39argd6e51uevyYaeDG rcouSfiNGNIdxAehBed2e2jQJ31sNSGnozz6xre2aHXvNiGmVtyiln9mm8MYu/fkVsS1 X30EQJrddtu8BBVQZVOmQm8wshiPNljd1Uwx8fhI8axcWa6k0uH6KM3skO9AjXEWY3Bl 3fvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774883891; x=1775488691; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=TyMY40B/fDbOHVd/wIa0YLN3SUzRpTnqoShQvzhc1SA=; b=GPwdNAHXCk2kmHby29DrqJ0fDmny0cKzSMqWfb0Gya9fp7sqHbEnPr5u9uRBFlhg6G nogpIozHSWG6Y6T5ugyzY82gUdFFGp/qtCSqf/l+aS9cWeVjJYZsCW3BWbUXoDPszmp4 VpX3cZPbjvYz3N+jbyHvO6/oBkMTbpRgPo3rHgMdrHy1g71L15HKGG9Q4rzcNnSCavF8 zWIW0Ecp44XAzrwKAGd50JohY2LRDoLcCI3jo80TsElZti5RKteAqALk1c6sMYqTg1Sf EkY6KvANFUSm7OZrCZtyjGzMBcM0orj//GYQDJ2otezwIFsxtFhBHe2P8yM/rYxc3aRV gX9g== X-Forwarded-Encrypted: i=1; AJvYcCVmRJuWgPqPnRFhLl6eM2Pt6aadN5kYxg4wik1q03+7qReaoxpS26ZqzsWrujzd05XZHxxvU6A0lC82EVg=@lists.postgresql.org X-Gm-Message-State: AOJu0YzRjWVoY3X51gXdEN6pIYn6emCdzldRHTaR2dOhNd10cqO8fix+ zOgaVY2kH082Mx7axYcz8GUjk21QIaPYcyBk0K6YyVMJMQMU0ZqhwqJmXWlixWuBjSSPFP9pHsS JI/Hn6pkQvToBHWAtpwyGhrpoQfkIzuk= X-Gm-Gg: ATEYQzwpLzEUyQDT+LfRLPwzUWJil8CKybTdAU5+ZfFsUOMRoPbjykYJfs4tg2Zm0iB xWYJvucNUJABXzcDudQ58zH5ySi68EoUjWoMexMeHy/jJzVUQdjPuA+U7nvyA7jnzv/oGjUbQPN UObOvwNlLFVwea1/sPQk0Aq/H3aw4aTUY9ZgM7t5pWg1MANRE7X72u8I28EXjZLDkYCLq8eYFuP moEXWyvpEz/olnsjonevuo5/HKn2zWhOb59FxrGT/bi5jn+w6O94AlNKLTEPtNFvPVu7OXvxF14 nb4sSkTFQuVax+rCxvV4UVGyQFP8KStXaqoC3l+L X-Received: by 2002:a05:6870:20f:b0:41b:f7f5:e8a7 with SMTP id 586e51a60fabf-41cec1dcd10mr6904546fac.15.1774883891267; Mon, 30 Mar 2026 08:18:11 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a05:6802:4a08:b0:628:1671:b3cf with HTTP; Mon, 30 Mar 2026 08:18:09 -0700 (PDT) In-Reply-To: References: <2006840.1774881078@sss.pgh.pa.us> From: "David G. Johnston" Date: Mon, 30 Mar 2026 08:18:09 -0700 X-Gm-Features: AQROBzAn6YOGT98z8stlZ5zxnxf7n7vo7l7ehxbDgOQkeqQU2w14lM5pAE9rfyU Message-ID: Subject: Re: Adding column in a recursive query To: Ibrahim Shaame Cc: Tom Lane , "depesz@depesz.com" , "pgsql-novice@lists.postgresql.org" Content-Type: multipart/alternative; boundary="000000000000db523b064e3f5b7b" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000db523b064e3f5b7b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 to use. The CTE column names clause doesn=E2=80=99t get used much that I have= seen. You have to write a full query inside the CTE anyway so column aliases are more conventional. David J. --000000000000db523b064e3f5b7b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Monday, March 30, 2026, Ibrahim Shaame <ishaame@gmail.com> wrote:
=
Effectively, after removing the column names from x(<= span>jina, namba, nasaba_1) it works now. Thank you very much. But then I d= on't understand the advantage or inconvenience=C2=A0of naming or not na= ming the columns there. Is there any explanation somewhere?

SQL is big on providing ways= to give aliases/names to things.=C2=A0 It just boils down to readability o= r, more often, conventions, as to which ones to use.=C2=A0 The CTE column n= ames clause doesn=E2=80=99t get used much that I have seen.=C2=A0 You have = to write a full query inside the CTE anyway so column aliases are more conv= entional.

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