jakob / Postico

Public issue tracking for Postico
https://eggerapps.at/postico/
476 stars 9 forks source link

Can't connect to PostgreSQL instance proxied through GCP's Cloud SQL Proxy #776

Open sjaq opened 3 years ago

sjaq commented 3 years ago

What did you do?

What did you expect to happen?

What actually happened?

What seems to be the issue?

What software versions are you using?

Postico version: 1.5.17 macOS version: 10.15.7 PostgreSQL version: PostgreSQL 13.2 on x86_64-pc-linux-gnu

declanwilson-lw commented 1 year ago

1 workaround:

host: localhost database: <your-db> username: gcloud config get account password: gcloud auth print-access-token

max-winderbaum commented 1 year ago

I'd also love the ability to explicitly disable SSL - this is super frustrating for me

eriknolte commented 1 month ago

Another way to do this is with a Pre-Connect Shell Script that starts the cloud_sql_proxy in the background. Unfortunately it doesn't shutdown the proxy when you disconnect from the database.

Postico 2 database configuration:

Host: localhost
Port: 5432
Database: <database>
User: <user>
Password: <password>
Pre-Connect Shell Script:
    GOOGLE_APPLICATION_CREDENTIALS="$HOME/.credentials/<project>.json"
    export GOOGLE_APPLICATION_CREDENTIALS
    <path-to-google-cloud-tools>/cloud_sql_proxy -instances=<project>:<region>:<database>=tcp:5432 &

It would be nice if Postico had a Post-Connect or Shutdown Shell Script option that could kill cloud_sql_proxy.