27

As the title states, if I connect to my heroku posgresql DB via pgAdmin4 I see many other databases which I am not allowed to access.

I know there must be a restrction DB field somewhere but I cant find it.

In pgAdmin4 its not in the advanced tab as stated here:

StackOverflow similar Question pgAdmin3

Community
  • 1
  • 1
Roman
  • 3,563
  • 5
  • 48
  • 104

2 Answers2

10

Actually, you can hide the rest of databases. When you fill in all credentials and connections parameters for the serevr, in order to avoid parsing so many databases, we have to white list only those databases we care about. Go to the Advanced tab and under db restriction copy the database name (it’s the same value as the Maintenance database field filled earlier). Remember - you have to set up this parameter BEFORE you hit "Save" as you cannot modify this field after saving. Source: https://medium.com/@vapurrmaid/getting-started-with-heroku-postgres-and-pgadmin-run-on-part-2-90d9499ed8fb

Alex D
  • 160
  • 2
  • 6
  • 4
    Indeed you can edit it. Just disconnect from the server first, then go to the Advanced tab and add the database as suggested and finally connect again to the server. That should do the trick (thanks btw Alex). – dariomac Jan 26 '21 at 11:56
1

You're probably using a Hobby-Dev or Hobby-Basic database. These used shared infrastructure. Although you can see the other (obfuscated) DB's in the list, you do not have access to them. To avoid seeing them, specify the DB name in your connection settings in pgAdmin.

jmccartie
  • 4,956
  • 8
  • 50
  • 71
  • 5
    In pgAdmin 4, the Connection tab for the Server has a Maintenance database field but specifying the Heroku database name does not filter out the others if you are using Hobby-Dev or Hobby-Basic. – nstuyvesant Mar 27 '17 at 03:02
  • @nstuyvesant same here, it does not filter them out. – sçuçu Jul 28 '21 at 09:20
  • Latest version of pgAdmin has an Advanced tab for the Server. Add the database name to the DB restriction field and it will limit your view. – nstuyvesant Jul 29 '21 at 13:58