Re: Using "where col in (?)"

From: Dave Cramer <davecramer(at)postgres(dot)rocks>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Blake McBride <blake1024(at)gmail(dot)com>, pgsql-jdbc(at)lists(dot)postgresql(dot)org
Subject: Re: Using "where col in (?)"
Date: 2022-04-29 15:35:01
Message-ID: CADK3HHJrjyUwk43qG9AAH9KaCz8GMd-oSSC4Vsntg_jKWZXACw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Fri, 29 Apr 2022 at 11:32, David G. Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>
wrote:

> On Fri, Apr 29, 2022 at 8:25 AM Blake McBride <blake1024(at)gmail(dot)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.
>

Thanks David, good catch!

Dave

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Blake McBride 2022-04-29 15:40:48 Re: Using "where col in (?)"
Previous Message David G. Johnston 2022-04-29 15:32:08 Re: Using "where col in (?)"