title: Connecting to Postgres SQL instance (private ip) with psql client
body: <p>I have a problem to connect on my CloudSQL Postgres instance with a psql client. I followed the documentation <a href="https://cloud.google.com/sql/docs/postgres/connect-admin-proxy" rel="nofollow noreferrer">https://cloud.google.com/sql/docs/postgres/connect-admin-proxy</a>.</p>
  <p>I have enable the Cloud SQL Admin API &amp; installed the cloud_sql_proxy :</p>
  <pre><code>wget https://dl.google.com/cloudsql/cloud_sql_proxy.linux.amd64 -O cloud_sql_proxy
  chmod +x cloud_sql_proxy
  </code></pre>
  <p>I use my credential SDK Cloud who have all the rights and i have set the good project :</p>
  <pre><code>gcloud config set project gta-staging-280808
  </code></pre>
  <p>Next, i have launch the following comandes :</p>
  <p>To test with TCP sockets :</p>
  <pre><code>./cloud_sql_proxy -instances=gta-staging-280808:europe-west1:${INSTANCE_ID}=tcp:5432
  psql &quot;host=127.0.0.1 sslmode=disable dbname=${DB_NAME} user=${USER}&quot;
  </code></pre>
  <p>To test with Unix sockets :</p>
  <pre><code>./cloud_sql_proxy -dir=/cloudsql &amp;
  psql &quot;sslmode=disable host=/cloudsql/gta-staging-280808:europe-west1:${INSTANCE_ID} user={USER}&quot;
  </code></pre>
  <p>Result:</p>
  <pre><code>2020/08/27 15:36:39 New connection for &quot;gta-staging-280808:europe-west1:${INSTANCE_ID}&quot;
  
  2020/08/27 15:40:59 couldn't connect to &quot;gta-staging-280808:europe-west1:${INSTANCE_ID}&quot;: dial tcp XX.XX.XX.XX:3307: connect: connection timed out
  </code></pre>
  <p>There is no SSH. The VPC is the default.</p>
  <p>Why it's doesn't work? Do you have any idea?</p>