How to delete/reset database?

I guessed that "postgres" is the database that shoudl be used. before restorign I have dropdb -U postgres --if-exists postgres -w -h "$SUPA_URL" to which I get
dropdb: error: database removal failed: ERROR: database "postgres" is being accessed by other users DETAIL: There are 4 other sessions using the database.
There's no 4 users! I am only one and I am not accesing it. I couldn't find any option to reset or even erase it. Do I have to delete whole project?
5 Replies
garyaustin
garyaustin2y ago
There are lots of potential users on the database. PostgREST server, gotrue server, storage server, realtime server and the supabase infrastructure. Under roles in the database tab you can see the users. All of those features also have tables in the database.
Roland
RolandOP2y ago
Thanks, I see many different roles and connections. It looks like you're not supposed to delete postgres database? how do I migrate entire database. Or I can use other name than postgres?
garyaustin
garyaustin2y ago
Not clear to me what you are doing, but you can create other databases but they will not be involved with auth/postgREST. https://github.com/orgs/supabase/discussions/4471
GitHub
Can I create multiple databases per project? · supabase · Discussio...
I am unclear the relationship between projects and databases. I am looking to migrate from Azure Postgres to Supabase and my app is split among 5 different database. Do I need to create 5 projects ...
garyaustin
garyaustin2y ago
You cannot delete or wipe the postgres database as then Supabase itself won't work with all its schemas, extenstions, etc.
Roland
RolandOP2y ago
thank you

Did you find this page helpful?