'Privileges dependent' error when try to drop a role/user even if there are no database attached and no role attributes I had a user/role that was a database owner;


so I dropped first the database;
I try dropping the user and I get the following error:



  role 'user_name' cannot be dropped because some objects depend ot it
  DETAIL: privileges for schema public


This is very confusing for me;

The schema public is the default schema schema when a database is created.

By dropping the database, shouldn't schema and other objects related to database dropped ?  Why this privileges error ?

I want not just a solution to fix it, but also to understand why.

I checked: 


with \l to be sure the database was droped
\du to check role attributes(empty)
PostgreSQL isn't MySQL. You can't drop databases or users without being attached to some database.  Based on the error message, the database you are attached to in order to execute the DROP USER statement is the one whose public schema has privileges granted to the doomed user.

Schema grants are not attributes of a role, so don't show up in \du.  To see them, you would use \dn+.