Re: how to resolve org.postgresql.util.PSQLException: ERROR: operator does not exist: text = integer?

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Karen Goh <karenworld(at)yahoo(dot)com>
Cc: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>, pgsql-sql <pgsql-sql(at)lists(dot)postgresql(dot)org>
Subject: Re: how to resolve org.postgresql.util.PSQLException: ERROR: operator does not exist: text = integer?
Date: 2019-07-16 16:00:46
Message-ID: CAKFQuwb_G5L9sY8hFxKD=HW_dGS57tmn+geL1ztGBMB4kWsUMQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Tue, Jul 16, 2019 at 8:44 AM Karen Goh <karenworld(at)yahoo(dot)com> wrote:

> I have been told In clause in the way to do it.
> So, not sure why am I getting that error....
>

Your query only has one comparison operation, ANY. In order for the query
to get as far as it did it must have two question marks present in the ANY
expression (since you've set two parameters in Java). Since the left side
of the ANY equality is subject_name you are attempting to compare against
the text type.

So explain why you think sticking an integer into the first parameter
location is something that makes sense here; i.e., ps2.setInt(1, tutor_id);
because that, with the information you've provided, is your error.

David J.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Andrew Gierth 2019-07-16 16:01:39 IN vs arrays (was: Re: how to resolve org.postgresql.util.PSQLException: ERROR: operator does not exist: text = integer?)
Previous Message Karen Goh 2019-07-16 15:44:03 Re: how to resolve org.postgresql.util.PSQLException: ERROR: operator does not exist: text = integer?