Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Restoring postgres sql file over 20gb

We have a backup of a database with sql 32gb format (containing various binary files over 50mb), but when we do import data only 8gb are actually placed on the bench.

We've done everything from changing the version that was Postgres 8.3 to Postgres 9.1 and even then not everything is imported.


1 Answers

It could be normal for Postgres.

When you export your binary data to sql file it must be encoded as base64 and properly escaped. This encoding and escaping can increase the size of the output file 2-6 times (from my experience). + sql dump format adds overhead for INSERT/COPY commands.

Try dumping the base in binary format, to see what size would the binary dump be.

like image 102
Ihor Romanchenko Avatar answered May 04 '26 19:05

Ihor Romanchenko



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!