PostgreSQL Security - Restricting the user access to the databases in Postgresql based on the permission
Created user can access all databases in post gre sql without any grant. We can allow permission to certain databases through editing the pg_hba.conf.Open PgAdmin , select pg_hba.conf from Tools -> Server Configuration
Disable Database and User all. Double click on the configuration line uncheck the Enable option.
Add new configuration and specify the user and system database "postgres" and your database here.
Then test the configuration is set properly or not, for testing the configuration login with the restricted user and try to access the database other than the rights given. Postgre SQL will reject access to the database if the configuration is set properly.
Please visit other related articles
PostgreSQL: Export PostgreSQL data in to excel file
PostgreSQL: How to restrict the user access to the databases in Postgresql based on the permission
PostgreSQL: List table details using Alt+F1 in PostgreSQL
PostgreSQL: How to get ROW_COUNT of last executed query in PostgreSQL like MS SQL @@ROWCOUNT ?