简体   繁体   中英

How to restore .dump or .sql on Azure PostgreSQL Server

I already have.dump and.sql but I am unable to restore it. I used pgAdmin, i can see the tables but there are no data in it.Same thing in Azure Studio and Navicat. I use "pg_restore" to restore the file but it doesn't throw any error.

The Right way to take a dump with data and restore is

./pg_dump -U postgres -p 5432 -h <remote_IP> -Ft dbname_source > dump_of_source.sql.tar 
./pg_restore -U postgres -h localhost -p 5432 -d dbname_target dump_of_source.sql.tar

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