Search code examples
postgresqlazurepsqlpgadminnavicat

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.


Solution

  • 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