Sample Header Ad - 728x90

How to list available users in PostgreSQL having only the data directory?

0 votes
2 answers
663 views
I messed up a bit with a Dockerized PostgreSQL instance and accidentally overwrote the values I had for POSTGRES_USER and POSTGRES_PASSWORD. They were randomly generated, so guessing them is basically out of the question. By nature of Dockerized PostgreSQL, if you specify your own username, the role postgres will not be created. That means that postgres, admin, root are all invalid roles on my DB instance. Now I'm stuck with a data directory in a volume that I can access and a psql that I cannot access because I don't know any valid username on that database. Is there a list of usernames in this data directory that I can somehow access to get inside and change the password?
Asked by illright (111 rep)
Dec 10, 2023, 01:35 AM
Last activity: Dec 10, 2023, 02:17 PM