mirror of
https://github.com/brianc/node-postgres.git
synced 2026-01-18 15:55:05 +00:00
Fixed the example to use both parameters - $1 and $2
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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user