TheSoul
TheSoul

Reputation: 5376

postgresql-heroku: unable to create a database

I have created a PostgreSQL database on Heroku. I have downloaded pgAdmin 4 on my macOS machine and I was able to connect pgAdmin to my remote Heroku database server instance I have just created. But now I can't do anything:

  1. The option to create a new database is disabled for me (Object -> Create -> Database)
  2. When I extend the databases node, I can't see the database name created in Heroku. But I see a long list of database names for which I don't have access rights
  3. Finally I can't write any SQL scripts; the SQL editor is read-only.

Basically I can't do nothing apart from starting the pgAdmin application.

I suppose it is a matter of my user privilege. But how can I change my user privilege if the SQL editor is read-only?

Upvotes: 0

Views: 174

Answers (1)

Chris
Chris

Reputation: 137228

You won't be able to create a database on Heroku Postgres with pgAdmin.

When you provision a database on Heroku Postgres you are given a single database, not administrative access to the whole server:

As part of the provisioning process, a DATABASE_URL config var is added to your app’s configuration. This contains the URL your app uses to access the database

You can connect to that existing database with pgAdmin, but you won't be able to create another database. The value of DATABASE_URL is a standard URI that will look something like

postgres://user:password@host:port/database

Feel free to pull individual values out of the DATABASE_URL and use them in pgAdmin.

Upvotes: 1

Related Questions