Deactivate postgres account

Is there a way to deactivate a postgres user account using an SQL statement?

I want to prevent the user from using his database, but without deleting the user or his databases.

+4
source share
2 answers

Take a look at the REVOKE command.

So that the user can connect to the database, he was granted the CONNECT privilege. Just return this privilege and he will not be able to use this database.

+5
source

You may also consider ALTER USER someone WITH NOLOGIN; which is probably the right solution if you have multiple databases in one backend and want to completely block the user.

0
source

All Articles