Steps to revoking grants before dropping a user: 1. Find all grants by granted by user to drop and regrant them as another user (superuser preferably). select regexp_replace(ddl,grantor,'<superuser>') ...