Re: Adding column in a recursive query - Mailing list pgsql-novice

From hubert depesz lubaczewski
Subject Re: Adding column in a recursive query
Date
Msg-id acppj9U8zquc2O7z@depesz.com
Whole thread Raw
In response to Adding column in a recursive query  (Ibrahim Shaame <ishaame@gmail.com>)
Responses Re: Adding column in a recursive query
List pgsql-novice
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




pgsql-novice by date:

Previous
From: Ibrahim Shaame
Date:
Subject: Adding column in a recursive query
Next
From: Ibrahim Shaame
Date:
Subject: Re: Adding column in a recursive query