PlanetScale Postgres

PlanetScale Postgres

Let AI connect your sources for you

Skip the manual setup — run this in your project and the wizard auto-detects your databases and APIs and connects them to PostHog.

Learn more
PostHog Wizard hedgehog

Connect PlanetScale Postgres to PostHog to sync your data into the PostHog data warehouse for analysis and modeling.

Enter your PlanetScale Postgres credentials to pull your data into the PostHog Data warehouse.

Configuration

OptionDescription
Connection string (optional)
Type: text
Required: False
Host
Type: text
Required: True

In the PlanetScale dashboard, open your database and click Connect to create a role and read its connection details. Use the host it shows, which looks like xxxxxxxxxx-useast1-1.horizon.psdb.cloud. PlanetScale always connects over TLS, which PostHog uses by default. A read-only role is enough for syncing.

Port
Type: number
Required: True

Use 5432 for a direct connection. Port 6432 goes through PSBouncer, which works for standard syncs but not for change data capture (CDC). PSBouncer pools in transaction mode, and logical replication can't run over it.

Database
Type: text
Required: True
User
Type: text
Required: True

PlanetScale usernames carry the branch id, so they look like postgres.xxxxxxxxxx.

Password
Type: password
Required: True
Schema
Type: text
Required: False

Linking PlanetScale Postgres to PostHog

  1. Go to the Data pipeline page in PostHog
  2. Click New source and select PlanetScale Postgres
  3. Fill in the required configuration fields
  4. Click Next, select the tables you want to sync, and then press Import