brianc/node-pg-copy-streams

Question: Continuous streaming

patrykwegrzyn opened this issue · 1 comments

Hi there is is possible to have continuous write stream to a table ?
Right now data makes to the server when stream finish/ends

Hello,

the COPY protocol corresponds to one sql transaction. The data is streamed to the server, but it can only be seen after the end of the transaction (when the 'finish' event is fired)

So the short answer is no. You cannot use COPY to have a continuous write stream to a table.

If that makes sense for you, you could chunk your source and do multiple copy operations (one for each chunk). This way you would have a sort of continous write stream.