Fixed the example to use both parameters - $1 and $2

Petr Kobalicek 2014-05-10 17:36:40 -07:00
parent 54e92da4a7
commit 5812781432

@ -25,7 +25,7 @@ pg.connect(function(err, client, done) {
//what you are doing is returning a client back to the pool while it
//is in the middle of a transaction. This is __very, very bad__.
process.nextTick(function() {
var text = 'INSERT INTO account(money) VALUES($1) WHERE id = $1';
var text = 'INSERT INTO account(money) VALUES($1) WHERE id = $2';
client.query(text, [100, 1], function(err) {
if(err) return rollback(client, done);
client.query(text, [-100, 2], function(err) {