A DigitalOcean managed PostgreSQL cluster listens on port 25060, not on 5432, and it only lets in addresses on its trusted sources list. In etlmcp's Postgres destination, give it the cluster's public hostname, set Port to 25060, and add etlmcp's address as a trusted source before you press Test. Point it at the cluster itself, not at a connection pool.
Change the port to 25060
DigitalOcean's migration guide states that its clusters take connections on port 25060 by default. etlmcp's Postgres destination fills the Port field with the standard Postgres port unless you change it, and that value is what it dials. If you leave the default, the test cannot reach the cluster. Copy the port from the Connection Details panel on the cluster's Overview page so you also catch a cluster set up differently.
Use the public hostname
Connection Details shows two hostnames: a public one and one for the VPC network. DigitalOcean's connection guide says only resources inside the same VPC network can use the private hostname. etlmcp does not run in your VPC. Before it connects, it looks up the host you entered, and if any address it gets back is not public, it stops and the test fails with host not allowed. If you see that message, check that you pasted the public hostname.
SSL is already settled
The connection details DigitalOcean gives you set sslmode=require by default: the traffic is encrypted, and the server certificate is not checked. etlmcp connects in require mode too, so you do not need to download the cluster's CA certificate or change anything for etlmcp. The verify-full option and the CA file matter for your own clients that check certificates; see Postgres SSL for how etlmcp treats SSL.
Add etlmcp to trusted sources
Trusted sources are the cluster's firewall: anything not on the list is kept out. Rules can name a Droplet, a Kubernetes cluster, an App, a tag, or an IP address or CIDR range. etlmcp runs outside your DigitalOcean account, so it needs an IP rule.
- When the server has an outbound address configured, etlmcp's Destinations page shows it under the destination list with the line "Behind a firewall? Allow connections from" followed by the address. Add that address as an IP rule. See firewall allowlists.
- Add a rule for every BI tool that reads the tables etlmcp loads, using the addresses its vendor publishes.
- DigitalOcean does not accept IPv6 rules on trusted sources, so enter IPv4 addresses.
- A cluster holds at most 100 rules. Use CIDR ranges where a vendor publishes them, rather than one rule per address.
- If you update rules in bulk through the API, the list you send replaces the whole list, so include the rules you want to keep.
Connect to the cluster, not a pool
DigitalOcean runs connection pools with PgBouncer, and each pool has its own connection details. A pool's mode is transaction by default and cannot be changed once the pool exists. In statement mode, DigitalOcean's pooling guide says, "Queries with multiple statements are not allowed and fail."
Each etlmcp run does its work in one transaction: it checks the table's columns, creates or widens the table if needed, deletes the rows of the date range it is about to replace, inserts the new rows, and commits. A statement-mode pool refuses that outright. A transaction-mode pool gains etlmcp nothing, since each run already does all its work on one connection. Enter the cluster's own host and port, the ones shown with no pool selected. The cluster's connection limit comes from its memory, so a direct connection from etlmcp counts against the same limit that your pools share.
A checklist
- Host: the public hostname from Connection Details.
- Port: 25060.
- Database and user: the database etlmcp writes to and a user that can create tables in its schema.
- Trusted sources: an IPv4 rule for etlmcp and one for each BI tool.
- Press Test on the destination. A test inserts one sample row and rolls it back.
The Postgres destination page lists every field.