title: GCP SQL Postgres problem with privileges : can't run a query with postgres user with generated symfony db
body: <p>I am struggling to solve this problem with Google Cloud Platform's Cloud SQL component. My tech stack consists of hosting my application in a Google Kubernetes Engine (GKE) deployment, using the Cloud SQL proxy sidecar to connect to the database within the pods. The backend is a Symfony project.</p>
  
  <p>I follow these steps to create and populate the database (without success):</p>
  
  <ol>
  <li>Create Cloud SQL Postgres instance</li>
  <li>Add proxy to k8s container to connect to the Cloud SQL instance with all credentials, as described in the <a href="https://cloud.google.com/sql/docs/postgres/connect-kubernetes-engine" rel="noreferrer">GCP documentation</a></li>
  <li>Enter my Symfony (<code>phpfpm</code>) pod and run the command <code>php bin/console doctrine:schema:update --force</code> to update the schema. The queries are executed in the database, so the schema is created and so on.</li>
  <li>I try to open the database from the SQL console connection within GCP with the <code>postgres</code> user and try to execute a simple <code>select * from foo;</code> query. The response is <code>Insufficient privilege: 7 ERROR:  permission denied for relation</code></li>
  </ol>
  
  <p>How can I query the data in the database with the <code>postgres</code> user?</p>
  
  <p><strong>EDIT :</strong></p>
  
  <p>I have this situation about users :</p>
  
  <pre><code>     Role name     |                         Attributes                         |           Member of           
  -------------------+------------------------------------------------------------+-------------------------------
   acando14          | Create role, Create DB                                     | {cloudsqlsuperuser,proxyuser}
   cloudsqladmin     | Superuser, Create role, Create DB, Replication, Bypass RLS | {}
   cloudsqlagent     | Create role, Create DB                                     | {cloudsqlsuperuser}
   cloudsqlreplica   | Replication                                                | {}
   cloudsqlsuperuser | Create role, Create DB                                     | {}
   postgres          | Create role, Create DB                                     | {cloudsqlsuperuser,acando14}
   proxyuser         | Create role, Create DB                                     | {cloudsqlsuperuser}
  </code></pre>
  
  <p>And I have this situation in the tables :</p>
  
  <pre><code>              List of relations
   Schema |      Name       | Type  |  Owner   
  --------+-----------------+-------+----------
   public | article         | table | acando14
  </code></pre>
  
  <p>If I use postgres user logged in my db <code>symfony</code> works :</p>
  
  <pre><code>symfony =&gt; select * from article;
   id | model_id | code | size 
  ----+----------+------+------
  (0 rows)
  </code></pre>
  
  <p>But if I use the server to execute the code the response is :</p>
  
  <blockquote>
    <p>SQLSTATE[42501]: Insufficient privilege: 7 ERROR: permission denied
    for relation employee at PDOException(code: 42501): SQLSTATE[42501]:
    Insufficient privilege: 7 ERROR: permission denied for relation .. at</p>
  </blockquote>
  
  <p>And another problem is that I didn't generate all the tables with the command but I have to generate it executing all the queries, so strange...</p>
  
  <p>Thank you, regards</p>