Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Restore Postgres database schema from *.sql file via pgAdmin?

I have several *.sql dump files that I would like to restore to a newly created database 'spatial_db'. I know that I can restore them via command line:

psql -U username -h 127.0.0.1 -d spatial_db -f path/to/dump/file.sql

Is there a way to restore the *.sql file(s) via pgAdmin as with *.backup files?

like image 390
Don P Avatar asked Sep 11 '26 16:09

Don P


1 Answers

  • Create the new db spatial_db.
  • Select the created db and go to Menu->Plugins->PSQL Console
  • Type the command to import the db \i /path/to/file.sql

Also if it is a small file you can open it in editor and execute the sql statements.

like image 88
Marlon Abeykoon Avatar answered Sep 15 '26 00:09

Marlon Abeykoon



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!