Skip to content

Instantly share code, notes, and snippets.

@a2ikm
Created March 17, 2024 07:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save a2ikm/8796eed52882833e01698898ecbcd95d to your computer and use it in GitHub Desktop.
Save a2ikm/8796eed52882833e01698898ecbcd95d to your computer and use it in GitHub Desktop.
How to run psqldef --export against your heroku PostgreSQL
# on your local machine
heroku run bash
# on one-off dyno
wget -O - https://github.com/sqldef/sqldef/releases/latest/download/psqldef_linux_amd64.tar.gz | tar xvz
./psqldef --user ${USERNAME_FROM_DATABASE_URL} --password-prompt --host ${HOSTNAME_FROM_DATABASE_URL} --export ${DATABASE_NAME_FROM_DATABASE_URL}
Enter Password:${PASSWORD_FROM_DATABASE_URL}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment