pganalyze/activerecord-copy

`put_copy_data': no COPY in progress (PG::Error)

x4d3 opened this issue · 3 comments

x4d3 commented

Hello,

I'm using the latest from master, as I wanted to add some functionality (See #3)

But I'm currently getting this error if I leave send_at_once to false.

activerecord-copy.rb:49:in `put_copy_data': no COPY in progress (PG::Error)

Everything works well if I put send_at_once to true

x4d3 commented

it usually happens after the 6th row have been saved.

x4d3 commented

I suspect that the issue is that row I'm trying to insert is too big.

Therefore in this line

https://github.com/pganalyze/activerecord-copy/blob/master/lib/activerecord-copy.rb#L48-L50

The io returned by get_intermediate_io is too big, to be put in one call.

x4d3 commented

I've found what was causing the error.
I was calling the database for something else in my block. and that interrupts the copy.

Sorry