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

From: Karen Goh <karenworld(at)yahoo(dot)com>
To: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
Cc: 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 15:44:03
Message-ID: 774827472.1178535.1563291843182@mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Tuesday, July 16, 2019, 11:21:47 PM GMT+8, Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk> wrote:

>>>>> "Karen" == Karen Goh <karenworld(at)yahoo(dot)com> writes:

>> What exactly is in your Program Files?

Karen> PostgreSQL which has folder named 10 and then open up you will
Karen> get to see bin folder, data folder, script folder ....

OK, and did you try doing "SHOW log_destination;" as a query, for
example in the pgadmin4 query window? also "SHOW logging_collector;"
and "SHOW data_directory;"

Alright. Thanks. Let me try it.

>> If you want to pass an array value as a parameter, you can't use IN
>> (x), you have to use = ANY (x) instead.

Karen> Is Any (x) this format applies only to Postgresql ?

scalar = ANY (arrayvalue) is a postgresql extension, yes.

The SQL spec says that the syntax

(col IN (1,2,3))

is equivalent to

(col = ANY (VALUES (1),(2),(3)))

but this doesn't allow you to pass a single array parameter for the IN
list either in PostgreSQL or in standard SQL. In both PostgreSQL and
standard SQL you can do:

(col = ANY (select v from unnest(arrayvalue) as u(v)))

but this isn't the recommended style for PostgreSQL because it is less
efficient.

I have been told In clause in the way to do it.
So, not sure why am I getting that error....
cos preferably not using any extension if it can be done using In clause..

--
Andrew (irc:RhodiumToad)

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message David G. Johnston 2019-07-16 16:00:46 Re: how to resolve org.postgresql.util.PSQLException: ERROR: operator does not exist: text = integer?
Previous Message Andrew Gierth 2019-07-16 15:21:31 Re: how to resolve org.postgresql.util.PSQLException: ERROR: operator does not exist: text = integer?