I was just testing the user creation process in pgAdmin. I have a database db1 for which I want to create a user to be able to connect to it. I want this to be the only database the user can connect to.
After creating the user, I opened my pg_hba.conf file and added a couple of lines:
host db1 dbuser 127.0.0.1/32 md5
host db1 dbuser ::1/128 md5
The postgres user has access to all the databases:
host all postgres 127.0.0.1/32 md5
host all postgres ::1/128 md5
When I connect to the server through pgAdmin, I get an error indicating that dbuser doesn't have access to the postgres database.
Is this normal? Should dbuser even require access to the postgres database, when I want him to only access db1? As soon as I add postgres to the list of databases for dbuser, I can connect.