Heroku Postgres
Created Dec. 2, 2023, 6:46 p.m.
Modified Nov. 15, 2025, 2:13 p.m.
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