PostgreSQL Delete Role with Dependencies

Here’s a list of privileges to revoke to enable complete removal of a user from a PostgreSQL database.

REVOKE ALL PRIVILEGES ON ALL TABLES IN SCHEMA public FROM username;
REVOKE ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public FROM username;
REVOKE ALL PRIVILEGES ON ALL FUNCTIONS IN SCHEMA public FROM username;
REVOKE USAGE ON SCHEMA public FROM username;
DROP USER username;

Leave a Reply

Your email address will not be published. Required fields are marked *