Tag: postgresql copy

节点/ postgres – 从STDIN结果复制不完整。 没有例外被抛出

我使用node-pg-copy将数据从mongodb批量导入到postgresql db 。 我使用observables来映射从mongodb进来的数据,然后将其写入到copyFrom正在使用的stream中。 有些东西是: function writeToStream (source, stream) { const trigger = Rx.Observable.fromEvent(stream, 'drain') hotsource = source.publish() const sub = trigger .takeUntil(hotSource.last()) .subscribe( data => stream.write(String(data)) && pauser.next(true), // pauser gets the next row to deal with concurrency. Using debugger, I can see that 'data' is ok every time. err => stream.emit('error', err), () […]