I believe you need to add "client.connect();" before actually running the stream thing; certainly this was necessary for me to get this code to work

dmaltzan 2013-10-21 08:17:04 -07:00
parent b97775d953
commit 89e99c149b

@ -325,6 +325,7 @@ Server expects from client sequence of rows encoded in CSV-like text. Rows can b
Example:
```javascript
var client = new Client({user: 'brianc', database: 'test'});
client.connect();
var stream = client.copyFrom("COPY names (user_name, age) FROM STDIN WITH CSV");
stream.on('close', function () {
console.log("Data inserted sucessfully");