Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
x4d3 opened this issue Mar 14, 2022 · 3 comments
Closed

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

x4d3 opened this issue Mar 14, 2022 · 3 comments

Comments

@x4d3
Copy link

x4d3 commented Mar 14, 2022

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
Copy link
Author

x4d3 commented Mar 14, 2022

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

@x4d3
Copy link
Author

x4d3 commented Mar 14, 2022

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
Copy link
Author

x4d3 commented Mar 15, 2022

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

@x4d3 x4d3 closed this as completed Mar 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant