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

From Andrew Gierth
Subject Re: how to resolve org.postgresql.util.PSQLException: ERROR: operator does not exist: text = integer?
Date
Msg-id 87sgr6ypvp.fsf@news-spur.riddles.org.uk
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>)
Responses Re: how to resolve org.postgresql.util.PSQLException: ERROR:operator does not exist: text = integer?
List pgsql-sql
>>>>> "Karen" == Karen Goh <karenworld@yahoo.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;"

 >> 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.

-- 
Andrew (irc:RhodiumToad)



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: Karen Goh
Date:
Subject: Re: how to resolve org.postgresql.util.PSQLException: ERROR:operator does not exist: text = integer?