Sunday, 15 January 2012

How to import huge sql file in postgresql? -



How to import huge sql file in postgresql? -

i've got postgres database dump, ~ 8gb ~, how can import it? i've got 4gb ram

already tried:

psql -d my_database -f huge_file.sql cat huge_file.sql | psql -d my_database

but it's returning me error:

............ out of memory

any solutions?

perhaps pg_restore can improve job psql. seek this:

pg_dump -fc my_database > db.dump

restore freshly created database called "newdb"

pg_restore -d newdb db.dump

postgresql import

No comments:

Post a Comment