I am having Postgres database dump file of 150 GB on Amazon EC2 instance. While dumping the data on RDS from EC2 server I am getting error.
The output of the command is as given below. It's giving error
1. psql connection not open 2. connection to server was lost on RDS dump postgres copy command Command Output: SET SET SET SET SET SET SET SET ALTER TABLE ALTER TABLE ALTER SEQUENCE ALTER TABLE psql:filename.sql:1396266: connection not open psql:filename.sql:1396266: connection to server was lost
Ruby 1.9.3 Rails 3 PostgreSQL 9.3
Please help why it is breaking while copying the data. As the connection was established and command is running. Suddenly while executing the copy command it is breaking.
Command/script that I am using to dump data the data is below:
psql -h instance.id.region-2.rds.amazonaws.com -p 5432 -U username -W -d database_name -f filename.sql
Workaround for finding issues as below:
I took head
100 rows and
tail 200 rows and made
1 file from the big
150 GB file it converted to 56KB. when I run this command, it's dumped successfully.
So the file size is causing problem. The same command is running for small size file for dumping data on RDS.
How can I resolve this issue?