postgres/gcppostgres: Add support for private service connect
Author: aplrCreated Mar 16, 2026Updated Mar 16, 2026
Is your feature request related to a problem? Please describe.
I am trying to connect a service using gocloud to a Google Cloud SQL instance which has private service connect enabled. However I'm encountering the following error:
Error: error connecting to PostgreSQL server <project_id>:europe-west1:<name> (gcppostgres): dial tcp <private_ip>:3307: connect: connection timed outI see that gocloud still uses v1 of the cloudsql proxy library and with it the legacy behaviour of connecting to the first IP address returned by the SQL Admin API. I see neither docs nor code mentioning PSC support.
Describe the solution you'd like
It is possible to connect to postgres instances on google cloud using private service connect.
Additional context
The underlying cloudsql proxy library may need to be updated.
To make this non-breaking, go-cloud could default to using the legacy behaviour (--auto-ip flag in CLI) and new features like PSC would be opt-in.
Source: google/go-cloud