From 89e99c149b34e5ca6a9e4b9d4871f8049a07dfe9 Mon Sep 17 00:00:00 2001 From: dmaltzan Date: Mon, 21 Oct 2013 08:17:04 -0700 Subject: [PATCH] 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 --- Client.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Client.md b/Client.md index c3447ac..f6f4b05 100644 --- a/Client.md +++ b/Client.md @@ -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");