connect-pg icon indicating copy to clipboard operation
connect-pg copied to clipboard

Invalid query for session destroy.

Open mdanilov opened this issue 11 years ago • 0 comments

this.getClient(function(err, client, done) {
  if (err) return fn(err);

  client.query('DELETE FROM ' + _this.table + ' WHERE sid = $2;', [ sid ], function(err) {
    done();
    if (err) return fn(err);
    fn();
  });
});

Postgres can't find $1 parameter and invoke error. If you replace $2 to $1 it will work.

Thanks.

mdanilov avatar Mar 12 '14 21:03 mdanilov