title: Cannot drop PostgreSQL role. Error: `cannot be dropped because some objects depend on it`
body: <p>I was trying to delete PostgreSQL user:</p>
  
  <pre><code>DROP USER ryan;
  </code></pre>
  
  <p>I received this error:</p>
  
  <blockquote>
  <pre><code>Error in query:
  ERROR: role "ryan" cannot be dropped because some objects depend on it
  DETAIL: privileges for database mydatabase
  </code></pre>
  </blockquote>
  
  <p>I looked for a solution from these threads:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/3023583/postgresql-how-to-quickly-drop-a-user-with-existing-privileges">PostgreSQL - how to quickly drop a user with existing privileges</a></li>
  <li><a href="https://stackoverflow.com/questions/32988702/how-to-drop-user-in-postgres-if-it-has-depending-objects">How to drop user in postgres if it has depending objects</a></li>
  </ul>
  
  <p>Still have the same error.</p>
  
  <p>This happens after I grant all permission to user "ryan" with:</p>
  
  <pre><code>GRANT ALL PRIVILEGES ON DATABASE mydatabase ON SCHEMA public TO ryan;
  </code></pre>