title: Not able to create read-only user in database with SELECT privileges only
body: <p>I want to create a Postgres user that has just read-only access to the database. </p>
  
  <p>I saw a similar question, but it had no resolution for my error. </p>
  
  <p>I even tried searching for the error but didn't find anything useful.</p>
  
  <p>Syntax:</p>
  
  <pre><code>GRANT CONNECT ON DATABASE YourDatabaseName TO Read_Only_User;
  GRANT USAGE ON SCHEMA public TO Read_Only_User;
  GRANT SELECT ON ALL TABLES IN SCHEMA public TO Read_Only_User;
  GRANT SELECT ON ALL SEQUENCES IN SCHEMA public TO Read_Only_User;
  
  # You can either grant USAGE to everyone
  GRANT USAGE ON SCHEMA public TO public;
  
  # Or grant it just to your read only user
  GRANT USAGE ON SCHEMA public TO readonlyuser;
  </code></pre>
  
  <p>But none worked. I logged in as a root user.</p>
  
  <p>I many times ended with the error</p>
  
  <pre><code>ERROR:  permission denied for relation querystoresearchclient
  </code></pre>
  
  <p>Could anyone help here?</p>