Check out our free resources, like our pganalyze eBooks and sign up to our newsletter.

Step 2: Attach Databases

Find out Heroku Postgres add-on name

First, find out the add-on name of your database - this is not the same as your application name on Heroku.

heroku addons

This will output something like the following:

Owning App  Add-on                       Plan                          Price  State
─────────── ───────────────────────────  ────────────────────────────  ────── ───────
testapp     postgresql-objective-11111   heroku-postgresql:hobby-dev   free   created

Attach database

Now, use that add-on name (postgresql-objective-11111 in the example) to attach the Heroku Postgres database to the collector.

You can utilize the --as parameter to specify an alias for this database, this is in particular useful when you attach multiple databases to the same collector.

heroku addons:attach postgresql-objective-11111 -a testapp-pganalyze-collector --as MYDB_PRIMARY

This will output the following:

Attaching postgresql-objective-11111 as MYDB_PRIMARY to ⬢ testapp-pganalyze-collector... done
Setting MYDB_PRIMARY config vars and restarting ⬢ testapp-pganalyze-collector... done, v9

You can now verify the configuration:

Continue to Step 3: Verify configuration

Couldn't find what you were looking for or want to talk about something specific?
Start a conversation with us →