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 1w7BXa-0052pY-0X for pgsql-novice@arkaria.postgresql.org; Mon, 30 Mar 2026 12:16:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w7BXY-0037Pt-1Z for pgsql-novice@arkaria.postgresql.org; Mon, 30 Mar 2026 12:16:20 +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 1w7BXY-0037Pl-0Y for pgsql-novice@lists.postgresql.org; Mon, 30 Mar 2026 12:16:20 +0000 Received: from lana.depesz.com ([88.198.49.178] helo=depesz.com) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1w7BXW-00000001nf9-1GA2 for pgsql-novice@lists.postgresql.org; Mon, 30 Mar 2026 12:16:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=depesz.com; s=20170201; h=In-Reply-To:Content-Type:MIME-Version:References:Reply-To: Message-ID:Subject:Cc:To:Sender:From:Date:Content-Transfer-Encoding: Content-ID:Content-Description; bh=1bp+kRXshDL8dqUIBF2ak10+ZAlFA1h/S3rC5+eGK68=; b=jhAs3Lk/nELNTvhVIeoZG9bS35 3RKfWkPql78FetyNeM37luyBWkFpsTmE8hqqVuiqHDKMwTOoSAjWkoFNPrNo1Wk5Te0GcqXEuQrHm n6Z/AHT1SuZSa3R7iT+eItfml8/UzgEpoUT7s804n7xFpCxtYEfO8uoeaqSWk5+Ogrec=; Received: from depesz by depesz.com with local (Exim 4.96) (envelope-from ) id 1w7BXT-00GtXx-2A; Mon, 30 Mar 2026 14:16:15 +0200 Date: Mon, 30 Mar 2026 14:16:15 +0200 From: hubert depesz lubaczewski Sender: depesz@depesz.com To: Ibrahim Shaame Cc: "pgsql-novice@lists.postgresql.org" Subject: Re: Adding column in a recursive query Message-ID: Reply-To: depesz@depesz.com References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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 = text > LINE 21: WHERE e.nasaba_1 = 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