Hey all,
I've been having an issue where the postgres database in Cloud SQL won't allow connections from anything outside the `psql` command line client - there's always a "too many connections for database 'postgres'" error. I've tried multiple things - increasing machine CPU/memory, restarting, even deleting the database instance and setting up a new one (which solved the problem for a few hours, but after a while the problem came back...).
Querying `pg_stat_activity` tells me there's only 9 connections (see attached image), and only 1 of which is from us and not Google Cloud.
The database instance is Postgres 13, db-g1-small with 1.7GB memory, 10GB HDD storage. Public IP is enabled and our IP addresses are definitely whitelisted. The zone is a single zone eu-west2 (London).
Another coworker said he can't even connect with the `psql` cli either, and DBeaver, PGAdmin, or our backend (in node using typeorm/pg modules) are all getting the same "too many connections for database" error.