Heroku Postgres

Heroku's addon to use a PostgreSQL Database.

To create a backup:

heroku pg:backups:capture -a dimmin

Download backup db to local

heroku pg:backups:download -a dimmin

Update the local PostgreSQL database

sudo -u postgres psql
DROP DATABASE "dimmin-staging";
CREATE DATABASE "dimmin-staging";
pg_restore -h "localhost" -p "5432" -U "postgres" -d "dimmin-staging" -v "latest.dump"

If you want to connect to a specific database using the postgres CLI, you can use the following:

sudo -u postgres psql
\c dimmin-staging
\dt

Previous Note 2023-12-02 Next Note 2023-12-03