brianc/node-postgres — pull request #675 by brianc (2014-11-11 04:29:32+00:00)
Title: Postgres Native bindings Segfault when querying with empty buffer

```js
var pg = require('pg').native;

pg.connect(function(err, client, done) {
if (err) throw err;

var c = 'CREATE TABLE IF NOT EXISTS posts (body TEXT)';

client.query(c, function(err) {
if (err) throw err;

c = 'INSERT INTO posts (body) VALUES ($1)';

var body = new Buffer('foo');
client.query(c, [body], function(err) {
if (err) throw err;

console.log('inserted foo');

body = new Buffer([]);
client.query(c, [body], function(err) {
done();

if (err) throw err;

console.log('inserted empty buffer');

pg.end();
});
});
});
});
```