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 1w7DWO-00554n-2S for pgsql-novice@arkaria.postgresql.org; Mon, 30 Mar 2026 14:23: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 1w7DWN-003biB-0J for pgsql-novice@arkaria.postgresql.org; Mon, 30 Mar 2026 14:23:15 +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.96) (envelope-from ) id 1w7DWM-003bi2-2k for pgsql-novice@lists.postgresql.org; Mon, 30 Mar 2026 14:23:15 +0000 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w7DWJ-000000020Qg-2s56 for pgsql-novice@lists.postgresql.org; Mon, 30 Mar 2026 14:23:15 +0000 Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-82ae378fff8so2880423b3a.2 for ; Mon, 30 Mar 2026 07:23:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1774880590; cv=none; d=google.com; s=arc-20240605; b=SQCa4/yKwDmXnAUG0PMywkmXz3/s1TRlDew0VNK9O0fSqAsljpVbfNZSAqm1XRScCD 3LaU5HkaARD0/BspJufhq+uNEq2oa/gFOC5K4ai0E9JrtVl3aLmku081qtB9Z5YTc9Zh 1ELo2ZLM4S9pAHdiNwKOk9z+QdJIF2s7CD9XVxZd6/B4QIcZOjSmYxnnj5ow6Vp+CUw0 2T3QDDR+AWk7UO3KxOQtR6f9Q+fyGcJEtVkczt/4AueM5imui1Iee2OXLNhidgcKIlu2 +eSj4AyQaD0QgRkiBisZqEy7/tcEY3jyrmBUj+XFD4KbQ3jjyGwnCjXG3uawd8bm++yP aovQ== 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=DTw8MnhghKit/3uoFDtVT8HHUK576USpmWBDcrdGpnk=; fh=AyfK7yaNGLAcXBxcQ4dpcX38PnrXWFWgRGjYZsQIkT4=; b=BWEC79AbAjf6Kk/FCbUJhWRfbYQxqwimDW4yasFTUxMtOuYfnYxr2td2tfzYvHcPtI LB7DkeQb5vAslxDAY9dt/HHoaI5Z12Sy0wDfLzDbRVzx6qa7FtQ0uTpVH0tX3Vg0nzk5 WPzBaLrl+hiKMaAE7TIe2MRmOK/Tm8MfFMpbPs1ytht6F7awxOfbTersEi1pLcR9btEQ s1/SYKox5RQcQP2hX8CXtLLsvoENdpPyGIRvYPYVrBzC4MTfcJCkFfFJKO2AMQPJfzPP ur9LoerVww1/nk0T8s5gAUf3r7huIfrxc+4lmaVoNHpfcCyNs35T9Dk/YQkZT/zifnhm SI2Q==; 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=1774880590; x=1775485390; 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=DTw8MnhghKit/3uoFDtVT8HHUK576USpmWBDcrdGpnk=; b=YX8QbLVcMQulsuIX4SwUvaTejkdsTbcttxoywrxJFCxJV6/vwefrNs04RUTg0Dn1i1 E9fnBQMAFP5w5j3zHiDHjuf+kFulqxCiW2uVuYyr16pDc8AyHBW4PUlAgbajvsyFi5WF Kv12hF9xfC1plf10/MHYHGjknbwF2x4pHu0pYcG1PE63C27htYztXzAhBkrVsAFCFjbO qASpW3f15QQSdto7U+4ntvEaiWIWLTpjUXN+Y/KuN+jPmWpBfY0iTZLhgfqUUdOYgK/m CYpaWsccFD9hIBW64ARnU7NUomqAtA0hD+5690+QEak5kY/MAWnrNCYt6Ay9KY14A/ik RfIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774880590; x=1775485390; 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=DTw8MnhghKit/3uoFDtVT8HHUK576USpmWBDcrdGpnk=; b=Y0ZNiptzMOlAkbQEv4qAowe9u5pZp6I7F4ePYRSKLX5OzgotRd6DNFeIsNNwYOeSEA vg0JIC0Mm+UN+klwvct1ocvB7P8e+Nk0Ok17Ia4kVsOuiLH1W/W0oD3PTzUIkkiyepo6 vYIbwYcW+olzYvH3clavTDCQVcb4AJORd/uOX/kU2g3GM9P884fnT9HB53llnrenloTu VP8ZR9kr+Sr7By02pzLsHJqJmdrEmCcYAt0tNrN7shrmA+LwKv2QeWoNWnLaERZ5mHws 7qy8eEVKVmk/AWwgljhrJglH1jYpbnI6wNl0LxTgYuqdVPAByJpXhY/iq0C1gfwMlM2s D7+A== X-Gm-Message-State: AOJu0YxfpsdABAW5y4X3WJotFm4J1JE3DKQnZ0H4qwYzgElHvswL1ij+ HPjyz/+oNrSpFofhy5nT4dQrVWFS7/HnYSSEApIeHb6TOVtabuzI1JQh3BSA0eHUCeb69yID9iS UhmbRLQAliYIMD4Y/ptI0603jioE2CRZkaw== X-Gm-Gg: ATEYQzwmXBRAbsvNjIPZ57DdVDW3c9aGUdy8ZevfvX7hG2B1Hp8/Y4OrRJLdah5DIK/ FK1hWX/conQGG3hICMB/7GRb3QTnH7DlIBnQnjSNAH4MtPi955juhq7jjdOmcNqXYRtfDJqsx8A 189Mq3vD5vJ56U5qyUVGF776NJCMs8J4/AKudJjvM8q7/ek5HAgj+TwqS7fenHJHqVYRNWTsuJ5 +M+aDwhv61Avz0EyzWJfCMuE5TJuw6uCl2BAKVpxiJFqpthqnNH0pkxloLi2IhORal8R4oK3+6L x0nDha3eOtRaYngwwFGsSECQwLCwPiwLWswRu8UKJRh157kT4qU= X-Received: by 2002:a05:6a00:600e:b0:82a:6de8:fa4f with SMTP id d2e1a72fcca58-82c95e4d61bmr12103865b3a.27.1774880589727; Mon, 30 Mar 2026 07:23:09 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Ibrahim Shaame Date: Mon, 30 Mar 2026 17:22:53 +0300 X-Gm-Features: AQROBzDhC5ZTHfLm1UVadHvtmCZAb1iQYjOM9P0iFRWuImxiCerw400rVEIYil8 Message-ID: Subject: Re: Adding column in a recursive query To: depesz@depesz.com Cc: "pgsql-novice@lists.postgresql.org" Content-Type: multipart/alternative; boundary="00000000000011cd42064e3e97fb" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000011cd42064e3e97fb Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello Hubert. Thanks for the reply. Both are integers and they work well without the two lines. So what changed one of them to text. Can you see where? I have not been able to identify. Regards Ibrahim On Mon, Mar 30, 2026 at 3:16=E2=80=AFPM hubert depesz lubaczewski wrote: > On Mon, Mar 30, 2026 at 01:20:14PM +0300, Ibrahim Shaame wrote: > > I have a working recursive query. I want to add another column, but it > > gives me an error: > > ERROR: operator does not exist: integer =3D text > > LINE 21: WHERE e.nasaba_1 =3D x_1.namba > > ^ > > HINT: No operator matches the given name and argument types. You might > > need to add explicit type casts. > > Any suggestion of where I am doing it wrong? > > You can't compare text and integer. > > Does 'abc' equal 0 ? > What about '01' and 1 ? > > Cast one side to the type of the other. Or, better yet, normalize > datatypes in tables, so that you don't have to compare across types. > > Best regards, > > depesz > > --00000000000011cd42064e3e97fb Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello Hubert.=C2=A0
Thanks for the reply. B= oth are integers and they work well without the two lines. So what changed = one of them to text. Can you see where? I have not been able to identify.
Regards
Ibrahim

On Mon, Mar 3= 0, 2026 at 3:16=E2=80=AFPM hubert depesz lubaczewski <depesz@depesz.com> wrote:
On Mon, Mar 30, 2026 at 01:20:14PM +030= 0, Ibrahim Shaame wrote:
> I have a working recursive query. I want to add another column, but it=
> gives me an error:
> ERROR:=C2=A0 operator does not exist: integer =3D text
> LINE 21:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0WHERE e.nasaba_1 =3D = x_1.namba
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0^
> HINT:=C2=A0 No operator matches the given name and argument types. You= might
> need to add explicit type casts.
> Any suggestion of where I am doing it wrong?

You can't compare text and integer.

Does 'abc' equal 0 ?
What about '01' and 1 ?

Cast one side to the type of the other. Or, better yet, normalize
datatypes in tables, so that you don't have to compare across types.
Best regards,

depesz

--00000000000011cd42064e3e97fb--