Re: Using "where col in (?)" - Mailing list pgsql-jdbc

From Blake McBride
Subject Re: Using "where col in (?)"
Date
Msg-id CABwHSOuq4N7BUw2txApqwxHu8sFxqxNJ=424nMUFkTyQ_+RAtg@mail.gmail.com
Whole thread Raw
In response to Re: Using "where col in (?)"  ("David G. Johnston" <david.g.johnston@gmail.com>)
Responses Re: Using "where col in (?)"  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-jdbc
I am wanting it to do the same as:  select * from se_user where user_id in (3, 4, 5)

On Fri, Apr 29, 2022 at 10:32 AM David G. Johnston <david.g.johnston@gmail.com> wrote:
On Fri, Apr 29, 2022 at 8:25 AM Blake McBride <blake1024@gmail.com> wrote:
I am getting the following JDBC error:

The error is a PostgreSQL one, JDBC is just the messenger here.
 

ERROR: operator does not exist: integer = integer[]
Hint: No operator matches the given name and argument types. You might
need to add explicit type casts. Position: 37 

select * from se_user where user_id in (?)


Why are you expecting: "integer IN (integer[])" to work?  It isn't documented anywhere that I'm aware of.

You can write that as: "integer = ANY(integer[])" though, that is documented.
David J.

pgsql-jdbc by date:

Previous
From: Dave Cramer
Date:
Subject: Re: Using "where col in (?)"
Next
From: "David G. Johnston"
Date:
Subject: Re: Using "where col in (?)"