Re: how to resolve org.postgresql.util.PSQLException: ERROR: operatordoes not exist: text = integer? - Mailing list pgsql-sql

From David G. Johnston
Subject Re: how to resolve org.postgresql.util.PSQLException: ERROR: operatordoes not exist: text = integer?
Date
Msg-id CAKFQuwb_G5L9sY8hFxKD=HW_dGS57tmn+geL1ztGBMB4kWsUMQ@mail.gmail.com
Whole thread Raw
In response to Re: how to resolve org.postgresql.util.PSQLException: ERROR:operator does not exist: text = integer?  (Karen Goh <karenworld@yahoo.com>)
List pgsql-sql
On Tue, Jul 16, 2019 at 8:44 AM Karen Goh <karenworld@yahoo.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.

pgsql-sql by date:

Previous
From: Karen Goh
Date:
Subject: Re: how to resolve org.postgresql.util.PSQLException: ERROR:operator does not exist: text = integer?
Next
From: Andrew Gierth
Date:
Subject: IN vs arrays (was: Re: how to resolve org.postgresql.util.PSQLException: ERROR: operator does not exist: text = integer?)