I have an importer who takes a list of letters and saves them in the postgres database. The following is a code snippet in an importer class without tables:
query_temporary_table = "CREATE TEMPORARY TABLE subscriber_imports (email CHARACTER VARYING(255)) ON COMMIT DROP;" query_copy = "COPY subscriber_imports(email) FROM STDIN WITH CSV;" query_delete = "DELETE FROM subscriber_imports WHERE email IN (SELECT email FROM subscribers WHERE suppressed_at IS NOT NULL OR list_id =
The problem I am facing is that when I try to download, I get an exception:
PG::ERROR: another command is already in progress: ROLLBACK
This is all done in one step, the only other queries I make are user validation, and I have a DB mutex that prevents import overlapping. This request worked until the end of my last click, including updating my pg gem to 0.14.1 from 0.13.2 (along with other "unrelated" code).
Initially, the error started on our intermediate server, but then I was able to reproduce it locally and was absent.
If I need to be more clear with my question, let me know.
thanks
source share