2

I'm learning some backend stuff, I made a test database locally and filled some data, and then I dump the database to an SQL file with the following command:

pg_dump -U USERNAME DATABASE —no-owner —no-acl -f backup.sql

And finally restore it to Heroku:

heroku pg:psql —app APPNAME < backup.sql

There is only 1 database I’m deploying, however, when I use PGAdmin to connect to it, it shows more than 2000 databases and crashes my computer:

screenshot of pgAdmin

Where are all these databases coming from?

ChrisGPT was on strike
  • 127,765
  • 105
  • 273
  • 257
JoeZHH
  • 35
  • 7
  • Tables and databases are different things. I don't use Heroku, but I suspect every time you are doing a restore you are creating a new database. Look at the Postgres logs for confirmation. – Adrian Klaver Oct 08 '21 at 19:20
  • Thank you for your correction @AdrianKlaver, I’ve updated the questions – JoeZHH Oct 08 '21 at 19:43
  • What Heroku plan are you on? If you're on one of the lower tiers like Hobby, then you don't get a dedicated app instance and have to share it with other Hobby databases/apps. – ellitt Oct 08 '21 at 19:46
  • Does this answer your question? [How to hide databases that I am not allowed to access](https://stackoverflow.com/questions/12663639/how-to-hide-databases-that-i-am-not-allowed-to-access) – Metro Smurf Oct 25 '22 at 20:02

1 Answers1

2

You don't get a dedicated PostgreSQL server with Heroku Postgres. Your databases are co-located with other users' databases on the same server. You'll be able to see the names of other users' databases, but you won't be able to access them.

I'm not sure what "crashes my computer" means, but make sure you are selecting your database when trying to connect.

ChrisGPT was on strike
  • 127,765
  • 105
  • 273
  • 257
  • 2
    You can hide them via a DB restriction: https://stackoverflow.com/questions/52999660/pgadmin-why-is-db-restriction-and-advanced-properties-disabled – mattyb Dec 15 '21 at 20:42