Reputation: 65
Is it possible to have multiple databases per one Heroku postgreSQL plan(instance)?
Upvotes: 6
Views: 6756
Reputation: 5
Actually this is not completly true. You are right, you do not have the permisson to create a database, but instead it is possible to just add more Heroku Postgres databases as Resources. This way you will have multiple plans(instances)
Upvotes: -2
Reputation: 2513
Unlike Amazon RDS, Heroku doesn't allow creating multiple databases – your DB role simply doesn't have permissions to CREATE DATABASE ..;
.
However, you can create several "apps", each one with its own Postgres and then use multiple Postgres DBs in single app (see for example https://devcenter.heroku.com/articles/heroku-postgresql#sharing-heroku-postgres-between-applications – this is a way to change "attached" database, but you can just add config vars pointing to multiple database credentials with heroku config
and then use those credentials inside your app).
Alternatively, you can create Amazon RDS Postgres (one or as many as you wish) in the same Availability Zone as your Heroku app, and use this Postgres instance (or several) in your Heroku app.
Upvotes: 6