The most common way to remove the Heroku Postgres add-on is through the Heroku client using the environment variable in the pattern HEROKU_POSTGRESQL_[COLOR]_URL:
$ heroku addons:remove HEROKU_POSTGRESQL_[COLOR]_URL --app your-app-name ! WARNING: Destructive Action ! This command will affect the app: your-app-name ! To proceed, type "your-app-name" or re-run this command with --confirm your-app-name > your-app-name Removing HEROKU_POSTGRESQL_[COLOR] on your-app-name... done, v19 (free)
In order to confirm the deletion, you must enter the application name.
It's also possible to delete the Heroku Postgres add-on through the Heroku dashboard. For that, access your application via https://dashboard.heroku.com/apps. Choose your application and click on the Edit button on the right; after that, click on the minus sign and finally click on Save.