title: Postgres grant privileges issue
body: <p>I have to create one database[myDB] and one custom schema[mySchema] not the public one.</p>
  
  <p>Where did I go wrong:</p>
  
  <p>I created 3 users: user_admin, user_rw, user_ro, which will be given access alter.</p>
  
  <p>Now, I login with my super user: postgres [I am using postgres 11 on GCP] through cloud shell.</p>
  
  <p>Created the my database: myDB, I went into myDB. And i fired below commands for all 3 users access.</p>
  
  <pre><code># for admin user
  GRANT CONNECT ON DATABASE myDB TO user-admin;
  GRANT USAGE ON SCHEMA mySchema TO user-admin ;
  GRANT ALL PRIVILEGES ON SCHEMA mySchema TO user-admin ;
  GRANT ALL ON ALL TABLES IN SCHEMA mySchema TO user-admin ;
  GRANT ALL ON ALL SEQUENCES IN SCHEMA mySchema TO user-admin ;
  GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA mySchema TO user-admin ;
  ALTER DEFAULT PRIVILEGES IN SCHEMA mySchema GRANT ALL PRIVILEGES ON TABLES TO user-admin;
  
  # for read write user
  GRANT CONNECT ON DATABASE myDB TO user-rw;
  GRANT USAGE ON SCHEMA mySchema TO user-rw ;
  GRANT SELECT,INSERT,UPDATE ON ALL TABLES IN SCHEMA mySchema TO user-rw ;
  GRANT SELECT,UPDATE ON ALL SEQUENCES IN SCHEMA mySchema TO user-rw ;
  GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA mySchema TO user-rw ;
  ALTER DEFAULT PRIVILEGES IN SCHEMA mySchema GRANT SELECT,INSERT,UPDATE ON TABLES TO user-rw;
  
  
  # for read only user 
  GRANT CONNECT ON DATABASE myDB TO user-ro;
  GRANT USAGE ON SCHEMA mySchema TO user-ro ;
  GRANT SELECT ON ALL TABLES IN SCHEMA mySchema TO user-ro ;
  GRANT SELECT ON ALL SEQUENCES IN SCHEMA mySchema TO user-ro ;
  GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA mySchema TO user-ro ;
  ALTER DEFAULT PRIVILEGES IN SCHEMA mySchema GRANT SELECT ON TABLES TO user-ro;
  </code></pre>
  
  <p>Till this point i did not have any issue. </p>
  
  <p>I created the table in mySchema with the help of user-admin, this would work like this in future as well.</p>
  
  <p>And rest two users will use just for read and another for read write.</p>
  
  <p>The problem is I can not able to see the created table from other users included postgres, user-rw, user-ro but only owner which was user-admin is having access to do all the operations like create and drop.</p>
  
  <p>Also, after creating the table from admin user, when i rerun below command, it gives me permission denied.</p>
  
  <pre><code>GRANT SELECT,INSERT,UPDATE ON ALL TABLES IN SCHEMA mySchema TO user-rw ;
  </code></pre>
  
  <p>Please let me know what i am doing wrong.</p>