Skip to content

Instantly share code, notes, and snippets.

@g-k
Created February 9, 2021 16:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save g-k/fe30d44f7b126b38c2eb88d07587eed4 to your computer and use it in GitHub Desktop.
Save g-k/fe30d44f7b126b38c2eb88d07587eed4 to your computer and use it in GitHub Desktop.

The following only works with the default user ('postgres'): gcloud sql connect --user If you try to connect using this command with any other user, the error message says FATAL: database 'user' does not exist. The workaround is to connect using the default user ('postgres'), then use the "\c" psql command to reconnect as the different user.

https://cloud.google.com/sql/docs/postgres/known-issues

Per :bobm:

cloud_sql_proxy -instances moz-fx-whatever-db-instance-name=tcp:PORT
psql postgres://USER@INTERNALIP:PORT/DBNAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment