This may be a duplicate of SELECT * FROM X WHERE id IN (...) with Dapper ORM
I am trying to achieve :
connection.execute("delete from table where id in @ids", new { ids = new int[]{1,2}});
But it's not working. I always get : ERROR: 42883: operator does not exist: integer = integer[].
Even if I do this :
connection.Query<a>("select * from a where a_id in @ids", new { ids = new int[] { 12, 13 } })
I get the same exception. I am accessing a postgresql database with Npgsql. Can you tell me what i am doing wrong ?
Here's what happens at the database for the second statement :
Here's some log for the second statement :
operator does not exist: integer = integer[] at character 33
No operator matches the given name and argument type(s). You might need to add explicit type casts.
select * from a where a_id in ((array[12,13])::int4[])
And this is for the first one (same as above but the last line is different)
delete from a where a_id in ((array[12,13])::int4[])