Connect PlanetScale Postgres to Infograph
What it brings in: Every table and view the user can read.
What you need
- A PlanetScale Postgres database.
- Permission to create a role on its branch.
- 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://[role].[branch-id]user: fix for "The username or password was not accepted.":[password]password: fix for "The username or password was not accepted."@[id]-[region].horizon.psdb.cloudhost: fix for "We couldn't find that host. Check the host name, then try again.":5432port: fix for "The host refused the connection. Check the port, and that your database accepts connections from Infograph's address."/[database]database: fix for "That database does not exist on this server."?sslmode=requireSteps
Allow Infograph's sync servers
If your database has IP restrictions in Settings, add the addresses below.
51.222.152.247/32Create a role
Open your database, click Connect at the top right, choose the branch and click Create role. Prefer a read-only role over the default postgres role. PlanetScale shows the password once, so copy it now.
Copy the connection string
Use port 5432. Port 6432 is PgBouncer, which breaks syncing. The user is the role name, a dot and the branch id, with no |replica or |bouncer suffix.
postgresql://[role].[branch-id]:[password]@[id]-[region].horizon.psdb.cloud:5432/[database]?sslmode=requirePaste it in Infograph and choose your tables
Open PlanetScale Postgres 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.
Copy the host from the Connect dialog again. It ends in horizon.psdb.cloud.
We couldn't find that host. Check the host name, then try again.
Copy the host from the Connect dialog rather than typing it, since it includes your database id and region.
The host refused the connection. Check the port, and that your database accepts connections from Infograph's address.
Check the port is 5432. Port 6432 is PgBouncer, 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 IP restrictions are set in Settings, add 51.222.152.247. Then check the host and port.
The username or password was not accepted.
PlanetScale shows a role's password only once. If you lost it, create a new role and paste its string. Check the user has no |replica or |bouncer suffix.
Those credentials were not accepted.
Check the user is the role name, a dot and the branch id, for the branch you chose. If the role was deleted, create a new one.
That database does not exist on this server.
Copy the string again from the Connect dialog so the database name after the last / is exact.