AD:
いろいろなやり方があるとは思うのですが、僕は下記のやり方で対応しました。
1.ローカルのデータをInsert文でDumpする
|
pg_dump -d your_database -t table_nme > specific_table_dump.sql --inserts |
–insertsの引数なしだとPostgresはCOPY文で出されるので、それだとHerokuに移す場合面倒なので、入れています。
![Screen Shot 2015-01-18 at 12.54.57 am](https://blog.mizoshiri.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-18-at-12.54.57-am-300x46.png)
2.HerokuのDBへPgAdminなどでつなげる
3.あとは上で作ったファイルをSQLを実行して終了
![Screen Shot 2015-01-18 at 12.56.49 am](https://blog.mizoshiri.com/wp-content/uploads/2015/01/Screen-Shot-2015-01-18-at-12.56.49-am-300x149.png)
Related posts
AD:
No Comments, Comment or Ping
Reply to “Postgresのローカルの指定したテーブルデータをHerokuに移す方法”
You must be logged in to post a comment.