To open a file in a database downloaded from Heroku

Asked 2 years ago, Updated 2 years ago, 59 views

I have a question about Heroku.Excuse me for the basics.

Unable to open the downloaded data file from the database on Heroku.

The same goes for Mac Notes, Text Edits, Excel and Word.

I have a question.
Is the only way to open the data downloaded from Heroku using PostgreSQL management tools such as pgAdmin?(To tell you my true feelings, it feels a little awkward to master PostgreSQL just for that purpose...)

For your information, the following commands are available when downloading from Heroku:

herokupg:backups download-a$ app name $

Thank you for your cooperation.

heroku

2022-09-30 19:45

1 Answers

I don't actually use Heroku, so I just looked into it a little bit.

Standard backups are binary data in dump format, so you need a client who can handle PostgresSQL data, but if you use the pg_dump command to back up in plain text format, you can only check the contents of any application.

Alex's answer in How can I get a plain text postgres database dump on heroku?

    Run
  • heroku config:get DATABASE_URL to get the results.

  • Look for PostgresSQL information in the results obtained.
    Example: HEROKU_POSTGRESQL_RED_URL:postgres://user3123:[email protected]:6212/db982398
    This is in the following format: postgres://<username>:<password>@<host_name>:<port>/<dbname>

  • Run the following command:

    pg_dump --host=<host_name>--port=<port>--username=<username>--password--dbname=<dbname>>output.sql
    

Run heroku config:get DATABASE_URL to get the results.

Look for PostgresSQL information in the results obtained.
Example: HEROKU_POSTGRESQL_RED_URL:postgres://user3123:[email protected]:6212/db982398
This is in the following format: postgres://<username>:<password>@<host_name>:<port>/<dbname>

Run the following command:

pg_dump --host=<host_name>--port=<port>--username=<username>--password--dbname=<dbname>>output.sql


2022-09-30 19:45

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.