brianc/node-postgres — Issue #82: Proper syntax for "WHERE ... IN ..."?
Author: jfeldstein
Created: 2012-01-13 07:33:15+00:00
State: open

I have an array of user ids, and would like to select all the users at once.

This query:

this.db.query({
text: "SELECT * FROM users WHERE remote_id IN $1 AND provider = $2",
values: [array_of_ids, provider_string]
}, cb);

Gives the error `error: syntax error at or near "$1"`

What's the correct syntax for this? Couldn't find it in the documentation or via google.

Thanks.