简体   繁体   中英

pulling single table from heroku postgresql

Can someone please help me how can i pull single table from heroku database.

I have tried the following way:

heroku db:pull --tables table_name

with no luck as heroku db:pull is deprecated now.

Thanks in Advance

Not sure if you can pull a single table from heroku but there are certainly some options to pull whole database.You can use Herokus PG Backups add-on to import or export your database . First you'll have to add it as add on in your app by

$ heroku addons:add pgbackups
$ heroku update

After that you can download your database by

$ heroku pgbackups:capture
$ curl -o latest.dump `heroku pgbackups:url`

You can also use pg:transfer Heroku CLI plugin to transfer the data in a single step.

From your app's directory, copy your production database locally (assuming a local PG db), by installing the plugin and execute the pg:transfer command.

$ heroku plugins:install https://github.com/ddollar/heroku-pg-transfer
$ heroku pg:transfer

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