Postgresql – Postgres revoke database access from user

postgresql

When I tried

REVOKE ALL PRIVILEGES ON DATABASE postgres from admin; 

but the user admin is still able to connect to postgres remotely via pgadmin after that.

How do I completely revoke an user's access to a database?

Log: https://pastebin.com/raw/Q2mfkf3P

enter image description here

Best Answer

The right to connect is by default granted to PUBLIC. You would have to revoke it from PUBLIC (and then grant it individually to other users who need it) to accomplish what you want.

Or use pg_hba.conf to deny the connection.