title: How to drop user in postgres if it has depending objects
body: <p>Database idd owner is role <code>idd_owner</code>.</p>
  
  <p>Database has 2 data schemas: <code>public</code> and <code>firma1</code>. 
  User may have directly or indirectly assigned rights in this database and objects.
  User is not owner of any object. It has only granted rights.</p>
  
  <p>How to drops such user ?</p>
  
  <p>I tried</p>
  
  <pre><code>revoke all on all tables in schema public,firma1 from "vantaa" cascade;
  revoke all on all sequences in schema public,firma1 from "vantaa" cascade;
  revoke all on database idd from "vantaa" cascade;
  revoke all on all functions in schema public,firma1 from "vantaa" cascade;
  revoke all on schema public,firma1 from "vantaa" cascade;
  revoke idd_owner from "vantaa" cascade;
  ALTER DEFAULT PRIVILEGES IN SCHEMA public,firma1 revoke all ON TABLES from "vantaa";
  DROP ROLE if exists "vantaa"
  </code></pre>
  
  <p>but got error</p>
  
  <pre><code>role "vantaa" cannot be dropped because some objects depend on it
  DETAIL:  privileges for schema public
  DROP ROLE if exists "vantaa"
  </code></pre>
  
  <p>How to fix this so that user can dropped ?</p>
  
  <p>How to create sql or plpgsql method which takes user name as parameter and drops this user in all cases without dropping data ?</p>
  
  <p>Using Postgres 9.1+</p>