Question: 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](https://i.stack.imgur.com/fdmP7.gif)](https://i.stack.imgur.com/fdmP7.gif)

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.
I think his session is still running.
The simple way to see it is:
`\conninfo`

Take a look at this, to avoid to restart postgresql:
<https://stackoverflow.com/questions/5108876/kill-a-postgresql-session-connection#answer-5109190>

EDIT

Hoping that this [link](http://wiki.postgresql.org/wiki/Shared_Database_Hosting) will be usefull.