How can I get a plain text postgres database dump on heroku?

前端 未结 5 1424
猫巷女王i
猫巷女王i 2020-12-07 14:14

Due to version incompatibilities of my postgres database on heroku (9.1) and my local installation (8.4) I need a plain text sql database dump file so I can put a copy of my

5条回答
  •  不思量自难忘°
    2020-12-07 14:41

    Heroku pg:backups:capture
    Heroku pg:backups:download
    

    Taken from https://devcenter.heroku.com/articles/heroku-postgres-import-export. Now you have a binary file. To obtain the file in plain text format, the following worked for me. Note: You will need to install PostgreSQL.

    pg_restore latest.dump > latest.sql
    

提交回复
热议问题