Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to import a huge file into PostgreSQL?

I am in a new project and I have to work with an existing PostgreSQL database now. The application is built with CakePHP. The problem I am facing while importing is that the file size of the database is around 4.8 GBs and I am totally new to PostgreSQL.

I have worked on MySql and NoSqls but PostgreSQL is appearing to be a tricky part for me. I even tried to import the file via Console, but again failed. I am using PostgreSQL on Ubuntu (Core i3). Please help me out of this.

Thanks in advance.

Nishant Shrivastava

like image 230
Nishant Shrivastava Avatar asked Mar 06 '12 07:03

Nishant Shrivastava


1 Answers

there are more possibilities

psql yourdb -f yourfile
psql yourdb < yourfile
cat yourfile | psql yourdb

psql yourdb
\i yourdb
like image 115
Pavel Stehule Avatar answered Sep 21 '22 22:09

Pavel Stehule