Last active
October 22, 2022 14:20
-
-
Save adevil5/20d7b9ba670133cc04f8fef8054d2a15 to your computer and use it in GitHub Desktop.
Drop Postgres User
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- (Optional) Change password to something unknown to the user | |
ALTER user my_user WITH PASSWORD 'delete-me'; | |
-- Shift ownership of objects to another user | |
REASSIGN OWNED BY my_user TO postgres; | |
-- Drop any privledges granted to the user (not sure why this isn't done automatically) | |
DROP OWNED BY my_user; | |
-- Drop the user | |
DROP user my_user; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment