Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ERROR: current transaction is aborted, commands ignored until end of transaction block --- export data from Aqua studio

I am trying to export one table from Aquastudio into CSV file. The table has approximately 4.4 million rows. When I am trying to use the export window function in the aqua studio, I am facing the following error:

Error: ERROR: current transaction is aborted, commands ignored until end of transaction block

I am not understanding what the problem is. I read few articles regarding this error and found that this is happening due to some error in the last postgreSQL command. I did not use any SQL commands for this export and I dont know how to debug this. I am also unable to view the log files.

like image 852
MrKrizzer Avatar asked Dec 13 '22 21:12

MrKrizzer


2 Answers

Use rollback to cancel the previous query. After that, you will be able to execute your current query.

like image 192
Michael Avatar answered Jan 13 '23 11:01

Michael


You probably shouldn't be exporting millions of rows through a JDBC/ODBC connection, especially for Redshift.

For Redshift, please use the UNLOAD command documented here. You'll have to UNLOAD the file to S3 and download it from there.

For Postgres, use COPY TO as documented here.

like image 41
Joe Harris Avatar answered Jan 13 '23 12:01

Joe Harris