Postgres can't detach or manually delete user and db

Looks like a bug we need to address. Sorry about that.

Anyways, it depends on your intentions. If you just want to drop the user and retain everything it owns, then it’s typically best to re-assign ownership.

You could connect to your database as the postgres user and run something like:

REASSIGN OWNED BY <user-to-remove> TO postgres;

If you’re user owns things across multiple databases you’d need to run that query in each db.

Once your’e done with that, you should be able to drop the user.

2 Likes