简体   繁体   English

从Heroku Postgresql中拉出单个表

[英]pulling single table from heroku postgresql

Can someone please help me how can i pull single table from heroku database. 有人可以帮助我如何从heroku数据库中提取单个表。

I have tried the following way: 我尝试了以下方法:

heroku db:pull --tables table_name

with no luck as heroku db:pull is deprecated now. 运气不好,因为heroku db:pull现在已弃用。

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 . 不知道是否可以从heroku中提取单个表,但是肯定有一些选项可以提取整个数据库。您可以使用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. 您也可以使用pg:transfer Heroku CLI plugin在单个步骤中传输数据。

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. 通过安装插件并执行pg:transfer命令,从应用程序的目录本地复制生产数据库(假设是本地PG db)。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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