Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Importing .sql file on windows to postgresql

I have a .sql file that was created by postgresql a while back. I now want to import this file onto a windows machine running postgresql.

How do I do this. The file is about 1.5gb.

like image 652
David Avatar asked Jul 08 '10 13:07

David


People also ask

Can we import .SQL file in PostgreSQL?

To import the SQL file, you get the IP address of the AlloyDB primary instance where your database is located and then use the psql tool to import the file into the database. Get the IP address of the AlloyDB primary instance where your database is located by viewing its details.


1 Answers

You should use psql command line tool:

psql -h hostname -p port_number -U username -f your_file.sql databasename  
like image 89
pcent Avatar answered Oct 05 '22 23:10

pcent