将postgres数据库转储导入本地应用

Sur*_*raj 2 postgresql ruby-on-rails

我在heroku的pg中有一个数据库转储。我也想在本地使用该数据库。

我们如何使用本地导入数据库转储 pgadmin

Neh*_*wal 5

您可以在中创建数据库PG并将转储导入到该数据库

$ pg_restore --verbose --clean --no-acl --no-owner -h localhost -U [username] -d [database name] latest.dump
Run Code Online (Sandbox Code Playgroud)

有关参考,您可以查看此博客:https : //cbabhusal.wordpress.com/2016/01/22/heroku-postgresql-dump-production-staging-database-to-localhost/