-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Description
Simple testcase:
var opts = {
"driver": "postgres",
"host": "localhost",
"user": "nodetest",
"password": "password",
"database": "nodetest"
}
var pg = require('pg');
pg.connect(opts, function(err, client) {
pg.end();
});
Then executing it:
% time node test_pg.js
^Cnode test_pg.js 2.49s user 0.66s system 0% cpu 14:10.42 total
I halted the program after 14 minutes. If I modify it like this:
var opts = {
"driver": "postgres",
"host": "localhost",
"user": "nodetest",
"password": "password",
"database": "nodetest"
}
var pg = require('pg');
pg.connect(opts, function(err, client) {
client.query('select * from person', function(){
pg.end();
});
});
Then it works:
% time node test_pg.js
node test_pg.js 0.12s user 0.02s system 11% cpu 1.142 total
Metadata
Metadata
Assignees
Labels
No labels