I’m trying to deploy a Django app on Digital Ocean. I have an Ubuntu 22.04 server set up on a droplet and have just set up a managed database cluster with Digital Ocean and added a recommended connection pool. From the connection pool Connection Details, I select the VPC network connection (Droplet and Database Cluster are both in the same DO Project), choose the flags option, and copy the connection string to the droplet server. This makes a successful connection. It gives me a message about the SSL connection like protocol (TLSv1.3), cipher, etc. It gives me a PSQL prompt and I successfully run a CREATE DATABASE command. I list the databases and see the database I just created. I then try to connect \c new_database_name; and I get this error:
connection to server at "[database name from connection string].c.db.ondigitalocean.com" (10.x.x.x), port 25061 failed: FATAL: no such database: [newly created database]
connection to server at "[database name from connection string].c.db.ondigitalocean.com" (10.x.x.x), port 25061 failed: FATAL: SSL required
I've setup apps like this on private, internal networks but never on a public cloud. How can I connect from the server to the DB and make sure my app connects when it is installed? Any help would be appreciated.
Postgres v14.9, UFW is active.
It was the recommended database connection pool. I deleted that, connected directly to the database and everythin proceeded as expected.