简体   繁体   中英

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?

  • 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM