Be sure you have postgres up and running and change the connection string in pgcopy.js
.
Run test.sql
to create the table.
$ npm install pg@6.0.3
With the changes introduced in brianc/node-pg-copy-streams#44:
$ npm install pg-copy-streams@1.1.1
$ # or install v1.1.2 through github since it was not published to npmjs
$ # npm install git+ssh://git@github.com/brianc/node-pg-copy-streams#v1.1.2
$ node pgcopy.js
fileStream finished
connected 192.168.99.100
pgStream ended
fileStream ended
pgStream ended
fileStream ended
Without the changes introduced in brianc/node-pg-copy-streams#44:
$ npm install pg-copy-streams@1.1.0
$ node pgcopy.js
fileStream finished
connected 192.168.99.100
pgStream ended
fileStream ended
I've observed that the streams are being ended multiple times and also that the read stream is not being finished with the changes introduced in brianc/node-pg-copy-streams#44.
The changes proposed in brianc/node-pg-copy-streams#54 fixes this issue.
$ npm install git+ssh://git@github.com/jeromew/node-pg-copy-streams#upstream-end
$ node pgcopy.js
fileStream finished
connected 192.168.99.100
pgStream ended
fileStream ended