I'm trying to write a query that takes a list parameter (ie, a single parameter which is a list of values). It appears that this is at least sometimes possible in PostgreSQL (https://stackoverflow.com/a/10829760/836390). What I want is something like this:
rows, err := db.Query("SELECT * FROM table WHERE id in $1", []int{1, 2, 3})
However, when I execute this using the pq driver, I get an error:
sql: converting Exec argument #0's type: unsupported type []int, a slice
Is this simply not supported in pq
yet, or is this not supported in database/sql
, or not in PostgreSQL at all, or what?