public inbox for pgsql-novice@postgresql.org  
help / color / mirror / Atom feed
From: hubert depesz lubaczewski <depesz@depesz.com>
To: Ibrahim Shaame <ishaame@gmail.com>
Cc: pgsql-novice@lists.postgresql.org <pgsql-novice@lists.postgresql.org>
Subject: Re: Adding column in a recursive query
Date: Mon, 30 Mar 2026 14:16:15 +0200
Message-ID: <acppj9U8zquc2O7z@depesz.com> (raw)
In-Reply-To: <CAJOWwD5_saumY5Xv1QAQ=VxwMQrz-tF6G-Fwek-ew52-=_uOXg@mail.gmail.com>
References: <CAJOWwD5_saumY5Xv1QAQ=VxwMQrz-tF6G-Fwek-ew52-=_uOXg@mail.gmail.com>

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






reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-novice@postgresql.org
  Cc: depesz@depesz.com, ishaame@gmail.com, pgsql-novice@lists.postgresql.org
  Subject: Re: Adding column in a recursive query
  In-Reply-To: <acppj9U8zquc2O7z@depesz.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox