From 5812781432bceb895d857ae18a551bef200e4f0e Mon Sep 17 00:00:00 2001 From: Petr Kobalicek Date: Sat, 10 May 2014 17:36:40 -0700 Subject: [PATCH] Fixed the example to use both parameters - $1 and $2 --- Transactions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Transactions.md b/Transactions.md index 684851b..79adf43 100644 --- a/Transactions.md +++ b/Transactions.md @@ -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) {