Linking Neon as a source

Alpha release

This source is currently in alpha. The interface and available tables may change.

The Neon connector can link your Neon database tables to PostHog. Neon is serverless Postgres, so this connector uses the same underlying integration as the Postgres source.

To link Neon:

  1. Go to the Data pipeline page and the sources tab in PostHog
  2. Click New source and select Neon
  3. Enter your Neon connection details. To find them, open your project in the Neon Console and click Connect – the connection details are shown there. Turn off the Connection pooling toggle to see the direct host:
    • Host: The direct host for your Neon endpoint, e.g. ep-cool-darkness-123456.us-east-2.aws.neon.tech. Avoid the pooled host (the one with -pooler in it) – pooled connections work for standard syncs, but change data capture (CDC) requires the direct host.
    • Port: The port your database is listening on. The default is 5432.
    • Database: The name of the database. Neon defaults this to neondb.
    • User: A user with read access to the schemas and tables you want to sync. Neon defaults this to neondb_owner.
    • Password: The password for the database user.
    • Schema: (Optional) The schema where your tables are located. Leave blank to browse and sync tables from all schemas, or specify one to limit the selection. Neon defaults this to public.
  4. If you need to connect through an SSH tunnel, enable and configure it (optional):
    • Tunnel host: The hostname of your SSH server.
    • Tunnel port: The port your SSH server is listening on.
    • Authentication type:
      • For password authentication, enter your SSH username and password.
      • For key-based authentication, enter your SSH username, private key, and optional passphrase.
    • Require TLS through tunnel? – Whether to require TLS encryption through the SSH tunnel. Enabled by default. Disable if your database does not support TLS.
  5. Click Link

PostHog then starts syncing your Neon data. You can see details and progress in the sources tab.

Configuration

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

In the Neon Console, open your project and click Connect to see your connection details. Use the direct host, e.g. ep-cool-darkness-123456.us-east-2.aws.neon.tech — not the pooled host (the one with -pooler). Pooled connections work for standard syncs, but change data capture (CDC) requires the direct host, and you must enable logical replication in your Neon project settings first. Neon requires SSL, which PostHog uses by default.

Port
Type: number
Required: True
Database
Type: text
Required: True
User
Type: text
Required: True
Password
Type: password
Required: True
Schema
Type: text
Required: False
Use SSH tunnel?
Type: ssh-tunnel
Required: False

CDC sync

Because Neon uses the Postgres integration, you can also enable change data capture (CDC) sync. See the Postgres source documentation for details. CDC sync is currently in alpha.

To use CDC with Neon:

  1. Enable logical replication in your Neon project settings. Note that this can't be disabled once enabled, and keeping an active replication connection prevents your compute from suspending.
  2. Use the direct host (without -pooler) when setting up the source – logical replication doesn't work through the connection pooler.

Selecting columns

By default, PostHog syncs all columns from each table. To sync only specific columns:

  1. During source setup, click Columns next to any table in the table picker.
  2. Clear the checkbox for any columns you don't want to sync.
  3. Primary key columns and the incremental sync field (if configured) are always synced and cannot be disabled.

You can also change column selection after setup:

  1. Go to the sources tab and click your Neon source.
  2. Click Configure next to any schema.
  3. Under Columns, select which columns to sync.

See the Postgres source documentation for details on resync behavior when adding columns.

Permissions The Neon source only requires read permissions on the schemas and tables you intend to sync. We recommend creating a dedicated read-only role in Neon rather than using the default neondb_owner role.

Neon requires SSL/TLS for all connections, which PostHog uses by default.

Inbound IP addresses

We use a set of IP addresses to access your instance. To ensure this connector works, add these IPs to your inbound security rules:

USEU
44.205.89.553.75.65.221
52.4.194.12218.197.246.42
44.208.188.1733.120.223.253

Community questions

Was this page useful?