Grant access to views in postgresql
<p>I have a view called testview in postgresql.</p>

<p>I created a new user called testuser. </p>

<p>I would like testuser to have all privileges on all tables and views in the database.</p>

<p>To do this I ran the following commands:</p>

<pre><code>GRANT ALL PRIVILEGES ON DATABASE testdb TO testuser;

GRANT USAGE ON SCHEMA public TO testuser;

GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO testuser;
</code></pre>

<p>testuser now has access to all tables in the database, but if I try to run SELECT * FROM testview I get the following error: permission denied for relation testview.</p>

<p>What is wrong? How do testuser get access to testview?</p>