Connect DigitalOcean PostgreSQL to Infograph
What it brings in: Every table and view the user can read.
What you need
- A DigitalOcean Managed PostgreSQL cluster.
- Access to its Overview and Network Access tabs.
- Infograph's sync servers connect from 51.222.152.247.
Your connection string
Each part is one thing you fill in, and each can fail on its own.
postgresql://doadminuser: fix for "The username or password was not accepted.":[password]password: fix for "The username or password was not accepted."@[cluster]-do-user-[n]-0.[x].db.ondigitalocean.comhost: fix for "We couldn't find that host. Check the host name, then try again.":25060port: fix for "The host refused the connection. Check the port, and that your database accepts connections from Infograph's address."/defaultdbdatabase: fix for "That database does not exist on this server."?sslmode=requireSteps
Allow Infograph's sync servers
If your cluster uses trusted sources, open its Network Access tab, choose Add Trusted Sources and add the addresses below.
51.222.152.247Create a read-only user
Infograph only reads. Give it its own user so you can see and revoke its access in one place. Run this as doadmin, with your own password and database name. Then use the new user and password in the string.
CREATE USER infograph WITH PASSWORD '[strong-password]'; GRANT CONNECT ON DATABASE [database] TO infograph; GRANT USAGE ON SCHEMA public TO infograph; GRANT SELECT ON ALL TABLES IN SCHEMA public TO infograph; ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO infograph;Copy the public connection string
On Overview, under Connection Details, choose Public network and your database, not a pool, then the Connection string format, and copy it. Keep port 25060. Port 25061 is for connection pools, which break syncing.
postgresql://doadmin:[password]@[cluster]-do-user-[n]-0.[x].db.ondigitalocean.com:25060/defaultdb?sslmode=requirePaste it in Infograph and choose your tables
Open DigitalOcean PostgreSQL in Infograph, paste the string and press Connect. Pick the tables you want and Infograph starts loading them.
Allow 51.222.152.247 through your firewall so Infograph can connect.
Connect
Troubleshooting
Each entry is the message Infograph shows when a connection fails. Open it for the fix.
This host is not reachable from Infograph. Use your database's public address.
A host starting with private- is the cluster's private network address. Choose Public network under Connection Details and copy the string again.
We couldn't find that host. Check the host name, then try again.
Copy the host from Connection Details rather than typing it, with Public network selected.
The host refused the connection. Check the port, and that your database accepts connections from Infograph's address.
Check the port is 25060. Port 25061 is for connection pools, which Infograph cannot use.
The server closed the connection. Check that it allows Infograph's address, and whether it requires an encrypted connection.
The server answered, then hung up before Infograph could sign in. Check it allows 51.222.152.247: some hosts close the connection rather than refuse it. If the server accepts only encrypted connections, set SSL Mode to Require under Advanced.
The host did not answer in time. Check the host and port, and that your firewall allows Infograph's address.
If the cluster uses trusted sources, add 51.222.152.247 under Network Access. Then check the host is the public one and the port is 25060.
The username or password was not accepted.
Copy the string again from Connection Details. Characters such as @, # or / must be percent-encoded, so @ becomes %40.
Those credentials were not accepted.
Copy the string again from Connection Details. If you created a read-only user, check its name and password in the string.
That database does not exist on this server.
Check you chose your database, not a pool, in Connection Details, and that the name after the last / matches it.