I have multiple databases in postgreSQL. I have created unique users with the intention of giving them access to a unique database. After creating the users, the first thing I did was use the following command:
GRANT ALL PRIVILEGES ON DATABASE dbname to username;
Then all the created users could connect to all the existing databases. After this I tried with a new user without granting any permissions. Instead I created a new role with connect on privilege to a particular database and attached this role to the new user. But the result was same, the new user could connect to any database. I then tried revoking all privileges with the command:
REVOKE ALL ON DATABASE dbname FROM PUBLIC;
The issue remains.