node-postgres/test/integration/gh-issues/130-tests.js
Brian M. Carlson 5f592a1240 Fix exception caused by column names with single quotes
Also rename some test files so they match the Makefile regex.  They will be included in the test suite from now on.
2014-01-22 08:38:29 -06:00

18 lines
543 B
JavaScript

var helper = require(__dirname + '/../test-helper');
var exec = require('child_process').exec;
helper.pg.defaults.poolIdleTimeout = 1000;
helper.pg.connect(helper.config, function(err,client) {
client.query("SELECT pg_backend_pid()", function(err, result) {
var pid = result.rows[0].pg_backend_pid;
exec('psql -c "select pg_terminate_backend('+pid+')" template1', assert.calls(function (error, stdout, stderr) {
assert.isNull(error);
}));
});
});
helper.pg.on('error', function(err, client) {
//swallow errors
});